The most troublesome thing in ASP is that it is inconvenient to debug the program. I think many friends may use this method "response.write" and then output relevant statements to see if it is correct. A few days ago, I wrote a thousand lines page, which contains about seven or eight SUB/FUNCTIONs. I used more than thirty responses.write during debugging. Oh my God, after debugging, delete these thirty one by one, which is tiring!
Today I saw a Debug class (VBS) in ASP. I tried it out, it was amazing!
How to use is very simple:
test.asp
<!--#INCLUDEFILE="debuggingConsole.asp"-->
<%
output="XXXX"
Setdebugstr=NewdebuggingConsole
debugstr.Enabled=true
debugstr.Print "value of parameter output", output
''...
debugstr.draw
Setdebugstr=Nothing
%>
======================================================================
debuggingConsole.asp
<%
ClassdebuggingConsole
privatebg_Enabled
privatebg_Show
privatebg_RequestTime
privatebg_FinishTime
privatebg_Data
privatebg_DB_Data
privatebg_AllVars
privatebg_Show_default
privateDivSets(2)
''Construktor=>setthedefaultvalues
PrivateSubClass_Initialize()
dbg_RequestTime=Now()
dbg_AllVars=false
Setdbg_Data=Server.CreateObject("Scripting.Dictionary")
DivSets(0)="<TR><TDstyle=''cursor:hand;''onclick=""javascript:if(document.getElementById(''data#sectname#'').style.display==''none''){document.getElementById(''data#sectname#'').style.display=''block'';}else{document.getElementById(''data#sectname#'').style.display=''none'';}""><DIVid=sect#s ectname#style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;"">|#title#|<DIVid=data#sectname#style=""cursor:text;display:none;background:#FFFFF;padding-left:8;""onclick=""window.event.cancelBubble=true;"">|#data#|</DIV>|"
DivSets(1)="<TR><TD><DIVid=sect#sectname#style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;""onclick=""javascript:if(document.getElementById(''data#sectname#'').style.display==''none''){document.getElementById(''data #sectname#'').style.display=''block'';}else{document.getElementById(''data#sectname#'').style.display=''none'';}"">|#title#|<DIVid=data#sectname#style=""cursor:text;display:block;background:#FFFFF;padding-left:8;""onclick=""window.event.cancelBubble=true;"">|#data#|</DIV>|"
DivSets(2)="<TR><TD><DIVid=sect#sectname#style=""background:#7EA5D7;color:lightsteelblue;padding-left:4;padding-right:4;padding-bottom:2;">|#title#|<DIVid=data#sectname#style=""display:none;background:lightsteelblue;padding-left:8"">|#data#|</DIV>|"