Adding Permanent Debugging Code
Written by Eric Smith, Northstar Computer Systems LLC
If you've built a lot of complex ASP code, you've probably added lots of Response.Write statements to print out values during the run of a page. As I hate having to re-enter all that data any time I have to debug the application, I created a handy function that is added "permanently" to the code. Based on a constant value defined in a server-side include file, the function will add comments to the output HTML with values that I need to see along the way. Here's the code:
Sub WriteDebugValue(strText)
If DEBUG Then
Response.Write "<!-- " & strText & " -->" & vbCrLf
End If
End Sub
The DEBUG constant is a simple constant defined like this:
Const DEBUG = True
If you want to disable the debugging code, just set the value to False.
Keywords: [
ASP Debugging
]
Publication Date: 1/1/2000, Last Update: 2/12/2010
|