>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
><!--#INCLUDE FILE="debuggingConsole.asp"--> ! t5 m- U6 Y2 z" }+ \6 d
>=================================================== </P>! t8 A2 z& ]' L% I
>debuggingConsole.asp </P>" j/ @5 o6 E5 f8 H6 c: B
><% 1 Z4 r# d% ~8 h
> private dbg_Enabled & Q2 S8 }# j, [/ H8 T& L9 Z7 i7 o
>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>* i- G- j$ U0 y# N+ T2 Q
> 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>0 n% ^ V3 v* ^ K) o0 \3 a
> 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 - W7 L( g6 S: W" i
>
ublic Property Get Show ''[string] Gets the debugging panel. ' | l: W$ }. t4 Z4 i
>
ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ( A B+ m& M; D3 [7 l1 }
>
ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
>'*********************************************************** ' d" R( n0 S J
> tbl = MakeTable(tbl) ' d4 P- c# p6 N- M" {$ e+ a, H
>'***********************************************************
rovider",oSQLDB.Properties("
rovider Name") & " Ver: " & oSQLDB.Properties("
rovider Version")) 6 m N9 \# i+ |$ ]8 e% _
>'***********************************************************
>'*********************************************************** " I2 e# f0 v: U! J6 d+ b+ W
>'***********************************************************
>'***********************************************************
>'Destructor
>End Class </P><
>%> </P><
>类的说明: </P><
>
>-------------------------------------------------------------------------------- </P><
>
ublic Properties </P><
>
roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
>
roperty Get AllVars===[bool] Gets if all variables will be displayed. </P><
>--------------------------------------------------------------------------------
>public sub===Print (label, output)
>public sub===GrabDatabaseInfo (byval oSQLDB) 9 t- i W, ~* Z' j
>public sub===draw () - I1 s2 j! ~! f2 v( d6 c& ~6 J3 v
>-------------------------------------------------------------------------------- | 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |