开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜