| w3Util Examples |
Examples
Debugging ASP, another approach | |
This article describes how to debug asp-code without using theVisual Studio debugging support, which more often than not is quitea match to get up and running. Instead we will use two components called w3 NetDebug and w3 Utils, both from Dimac. |
|
The general ideaw3 Utils should be installed on the webserver, it
provides a lotof nice functions but for now we will focus on one of
them, debugWrite. When calling debugWrite we send a network
message which we pick up in a small clientprogram called w3 NetDebug.
NetDebug is a commandline program which monitors netDebug messageson
your local network. How to do itFirst of all, you will need to get and install Dimac w3 Utils on your webserver. You can find this component at www.dimac.net.We create the netUtils object in a asp-page like this:
|
|
|
<%
net = Server.CreateObject( "w3.netutils" ) %> |
|
Meanwhile at another (or the same) computer in the local network, we start the w3 NetDebug client. It should look something like this: Now then, add a debugWrite call to the asp page. The code looks like this: |
|
|
<%
Set net = Server.CreateObject ( "w3.netutils" )net.debugWrite "coding and stuff" %> |
|
Now, if you run the asp-page you will see the message appear instantly in the NetDebug client, like this: Nice huh? Well, the following sample shows how you write variables to the netDebug client: |
|
|
<%
Set net = Server.CreateObject ( "w3.netutils" ) net.debugWrite ( "New run ===========" ) for i=0 to 4 net.debugwrite( "i = " & i ) if i=3 then net.debugwrite( "Here we go" ) end if next %> |
|
Tips and tricksFiltering |
|
|
<%
Set net = Server.CreateObject ( "w3.netutils" ) net.debugWrite "mystuff: i = " & i %> |
|
|