ASP/VB debug function
We are using ASP/VB on our webserver and we often include print statements to test things. Is it possible to make a debug function or sub that takes one argument (a string), and prints out that string with the linenumber from the caller?
开发者_开发百科Even a tip of how I could get a traceback should give me enough info to write this function, but I couldn't find such function.
The easiest way is to just raise an error and let the debugger kick in.
Err.Raise 1, "Title", "Your Text"
Then either in an include or in a 500
error page you can use Server.GetLastError()
to get the error which includes the relevant information such as LineNumber
and Source
.
精彩评论