>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P># j% r) ^; ~6 [ x A8 y9 l+ R
>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
><!--#INCLUDE FILE="debuggingConsole.asp"--> ) g+ e5 Z: D" n" s( L# u
>=================================================== </P>4 v. A$ n3 j2 x: @, d
>debuggingConsole.asp </P>4 d7 V8 K) b4 m$ G
><% 1 A+ }2 o9 R$ g
> private dbg_Enabled $ m. D0 A" M' d3 N
>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>1 @0 B8 D4 B7 q0 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 * B& ?* {% R' `/ U) _
>
ublic Property Get Enabled ''[bool] Gets the "enabled" value " [) o4 m$ [$ j1 t: y4 E1 H) q
>
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 D! A2 u, N$ o6 U9 } ]6 o9 F
>
ublic Property Get Show ''[string] Gets the debugging panel. 7 N1 B# k2 w/ _! j4 b7 e# N/ Z
>
ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false , X( d: W3 h. x( c8 f: D
>
ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
>'***********************************************************
> tbl = MakeTable(tbl)
>'*********************************************************** : q& H& J% S8 q; W. @ j, w
rovider",oSQLDB.Properties("
rovider Name") & " Ver: " & oSQLDB.Properties("
rovider Version"))
>'***********************************************************
>'***********************************************************
>'*********************************************************** " I4 g p @- G8 ?
>'*********************************************************** ( o& B$ r7 J* N9 d# m& x, X9 [
>'Destructor
>End Class </P><
>%> </P><
>类的说明: </P><
>$ Q4 c* I5 s7 r! @- X
>-------------------------------------------------------------------------------- </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) $ S, t( y2 B' F$ @- K$ K' a
>public sub===GrabDatabaseInfo (byval oSQLDB) # g2 p1 j+ o5 `8 a6 l
>public sub===draw ()
>-------------------------------------------------------------------------------- . V1 i: f1 K0 C* h5 Y' K| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |