INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Debugging ASP

How can you debug ASP without a debugger? by Wendell
Posted: 17 May 00

It's always best to have a debugger, the step into and step over fuctions, etc., server-side especially, are life savers.  But, if you don't have one (for what ever reason) try saving the following code into a seperate file - with an asp or inc extension recommended - and simply <!--#Include File="the file name" //-->

<%
Dim bDebugging

Sub TraceStart()
   bDebugging = True
   DebugIt "Tracing started"
End Sub

Sub TraceStop()
   DebugIt "Tracing stopped"
   bDebugging = False
End Sub

Sub DebugIt( strString )
   If bDebugging Then
      Response.Write "Debugging: " & strString & "<br>"
   End If
End Sub

Sub TraceProcedureStart( strProcedure )
   DebugIt strProcedure & " started"
End Sub

Sub TraceProcedureEnd( strProcedure )
   DebugIt strProcedure & " ended"
End Sub

Sub CheckError()
   Response.Write "<br>Error Description is: " & Err.Description & ".<br>"
End Sub
%>

Then you can TraceStart(), and DebugIt"variable name = " & variable name, and TraceStop() {on seperate lines} to gain visiblity to what's going on at that point.  Better yet, TraceStart() once at the start of the file, and TraceStop() at the end, then you can DebugIt" " as many times as you want - and if you don't want to comment each one out or delete them you can simply set bDebugging to False in TraceStart.  Enjoy, Wendell

Back to Microsoft: ASP (Active Server Pages) FAQ Index
Back to Microsoft: ASP (Active Server Pages) Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close