>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
><!--#INCLUDE FILE="debuggingConsole.asp"--> + q% {6 n N# l, g X
>=================================================== </P>
>debuggingConsole.asp </P>
><% ; K' _5 {4 t/ E7 u2 Z
> private dbg_Enabled
>DivSets(0) = "<TR><TD style='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';}""><DIV id=sect#sectname# style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;"">|#title#| <DIV id=data#sectname# style=""cursor:text;display:none;background:#FFFFFF;padding-left:8;"" onclick=""window.event.cancelBubble = true;"">|#data#| </DIV>|</DIV>|" </P>
> DivSets(1) = "<TR><TD>) d, Q) ^2 [- t/ u$ m5 E
> DivSets(2) = "<TR><TD><DIV id=sect#sectname# style=""background:#7EA5D7;color:lightsteelblue;padding-left:4;padding-right:4;padding-bottom:2;"">|#title#| <DIV id=data#sectname# style=""display:none;background:lightsteelblue;padding-left:8"">|#data#| </DIV>|</DIV>|" </P>
> dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
>
ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
>
ublic Property Get Enabled ''[bool] Gets the "enabled" value
>
ublic Property Let Show(bNewValue) ''[string] Sets the debugging panel. Where each digit in the string represents a debug information pane in order (11 of them). 1=open, 0=closed 8 y7 U) i2 O1 B c/ a4 W; u5 o
>
ublic Property Get Show ''[string] Gets the debugging panel.
>
ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false & s/ e8 f% A& `/ `% w
>
ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
>'***********************************************************
> tbl = MakeTable(tbl)
>'*********************************************************** 6 F3 L0 v+ a" z$ j1 C3 Y
rovider",oSQLDB.Properties("
rovider Name") & " Ver: " & oSQLDB.Properties("
rovider Version"))
>'***********************************************************
>'*********************************************************** 8 Y3 d7 Z" ?) ?& j$ r7 j
>'***********************************************************
>'***********************************************************
>'Destructor
>End Class </P><
>%> </P><
>类的说明: </P><
>
>-------------------------------------------------------------------------------- </P><
>
ublic Properties </P><
>
roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 n9 r: {: n& @3 a2 x, C
>
roperty Get AllVars===[bool] Gets if all variables will be displayed. </P><
>-------------------------------------------------------------------------------- 0 `$ o& p% G) M x% w5 H5 b. E
>public sub===Print (label, output)
>public sub===GrabDatabaseInfo (byval oSQLDB)
>public sub===draw () # _3 K: i, M7 ?. ?8 C* e0 r
>-------------------------------------------------------------------------------- | 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |