数学建模社区-数学中国

标题: ASP中令人震撼的Debug类(VBScript) [打印本页]

作者: 韩冰    时间: 2004-11-21 11:43
标题: ASP中令人震撼的Debug类(VBScript)
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P># j% r) ^; ~6 [  x  A8 y9 l+ R
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
2 Q" d+ y' P" a# B3 f使用方法很简单: * e4 n4 @/ L7 S( v; o9 F2 \
test.asp </P>
& B( S) Q' H. q$ R7 }+ q7 a<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ) g+ e5 Z: D" n" s( L# u
&lt;% + N8 a8 z. a' l- i* S0 D
output="XXXX"
8 }! S/ k7 x; OSet debugstr = New debuggingConsole
* _" H, a0 e/ X" h2 }6 U; t' kdebugstr.Enabled = true 1 U+ s) Q; m6 P! `$ P
   debugstr.Print "参数output的值", output   e5 m4 h" l. E/ N
   '……
2 s$ u  m% l; e6 @4 g$ F/ n/ u   debugstr.draw
* k! Y* U  v4 R: h0 L2 }& MSet debugstr = Nothing % A. J$ Q/ E1 _
%&gt; </P>
9 p6 |" K2 |- k8 E: g<>=================================================== </P>4 v. A$ n3 j2 x: @, d
<>debuggingConsole.asp </P>4 d7 V8 K) b4 m$ G
<>&lt;% 1 A+ }2 o9 R$ g
Class debuggingConsole </P>
+ u+ i: A0 Z. X- X<>   private dbg_Enabled $ m. D0 A" M' d3 N
   private dbg_Show ( |! n$ ]8 Y2 b. J3 E
   private dbg_RequestTime : _& X& {! V3 u$ E8 t: n$ R6 W
   private dbg_FinishTime   P* T9 Y) M: L$ l4 e# H
   private dbg_Data - j0 R3 ^! X# c% s/ w, Y
   private dbg_DB_Data 5 S6 z/ e$ H* u/ y! g9 K
   private dbg_AllVars
- U, Q: Q: L7 n, ~+ H   private dbg_Show_default # [& ^& B: j3 `: ]
   private DivSets(2)
: ~2 V, s* Q! {- {. G, l   
# D: F1 I6 j; A# `'Construktor =&gt; set the default values
; H" E7 Q* a+ r$ I5 P" Q( ^Private Sub Class_Initialize() ! A4 B* r% p( [) V& J0 ^
   dbg_RequestTime = Now()
' w" d" Z: ~" z, `1 }: ^: A   dbg_AllVars = false
3 s$ A* ]/ F; T   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
. c* f& C  S; E# i$ ]* O<>DivSets(0) = "&lt;TR&gt;&lt;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';}""&gt;&lt;DIV id=sect#sectname# style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;""&gt;|#title#| &lt;DIV id=data#sectname# style=""cursor:text;display:none;background:#FFFFFF;padding-left:8;"" onclick=""window.event.cancelBubble = true;""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>
1 _" S& ~. V- p0 s6 h) }<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;1 @0 B8 D4 B7 q0 e
&lt;DIV id=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';}""&gt;|#title#| &lt;DIV id=data#sectname# style=""cursor:text;display:block;background:#FFFFFF;padding-left:8;"" onclick=""window.event.cancelBubble = true;""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>; O9 U  W1 r7 H! y) O4 r1 T
<>   DivSets(2) = "&lt;TR&gt;&lt;TD&gt;&lt;DIV id=sect#sectname# style=""background:#7EA5D7;color:lightsteelblue;padding-left:4;padding-right:4;padding-bottom:2;""&gt;|#title#| &lt;DIV id=data#sectname# style=""display:none;background:lightsteelblue;padding-left:8""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>
* e. M+ v2 o/ q0 h5 X( ^3 d<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
) K! b, ^/ \6 l. Y/ Y: \& DEnd Sub </P>
, I* P/ B* @4 g. Y5 b<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false * B& ?* {% R' `/ U) _
   dbg_Enabled = bNewValue 5 \. S' S% A- N3 T
End Property </P>8 m9 p  t6 R( z4 n' Y- [. A3 H
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value " [) o4 m$ [$ j1 t: y4 E1 H) q
   Enabled = dbg_Enabled
) l  x9 w$ c# g7 e* w) Y) v$ [End Property </P>, u: l, }0 o9 Z% d- M8 P% y0 f
<>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
   dbg_Show = bNewValue
: w+ t" h6 o, R. T8 jEnd Property </P>  z) P; z5 A, I0 {# N( G+ v
<>ublic Property Get Show ''[string] Gets the debugging panel. 7 N1 B# k2 w/ _! j4 b7 e# N/ Z
   Show = dbg_Show
' e2 q2 Q8 q- b2 TEnd Property </P>
4 N. J( L7 [# q7 x<>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
   dbg_AllVars = bNewValue
- P# _1 J' d: }$ T2 z7 p5 ?End Property </P>" I. {: j! [& G  p9 S, R
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
- r" p  q  `7 I' m# v   AllVars = dbg_AllVars ) Q+ j- L+ S' [
End Property </P>
6 H( U2 ?' }9 f9 n& a<>'***********************************************************
: N- T& ]! j. U8 ^$ M" A''@SDESCRIPTION: Adds a variable to the debug-informations. 6 m' c) K6 a; j1 n! f7 G
''@PARAM:  - label [string]: Description of the variable
& o3 v7 n2 I5 g8 x- g' M  B( W# S) D''@PARAM:  - output [variable]: The variable itself & W8 U* n6 O2 |0 u
'***********************************************************
( h/ `2 u" I" M: P6 e) HPublic Sub Print(label, output) # ]( L& K; s9 G+ c
   If dbg_Enabled Then / J; n4 }% P4 f) j
     if err.number &gt; 0 then
8 S2 R2 x$ L  V# l+ p/ y1 s; m4 z       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
6 u* [0 j& p; D, M       err.Clear
: V! Y- B0 f4 C/ A# Z2 G0 v     else
) E' G1 U/ ~( F& u0 S       uniqueID = ValidLabel(label) ( X- u% X/ j2 d5 I2 U+ O
       response.write uniqueID ; \$ @3 Q0 i9 S( o
       call dbg_Data.Add(uniqueID, output)
& w7 E4 I1 l. I     end if ) y4 {. ~. {4 Z4 o3 U
   End If
7 E) F* g" Z8 P$ q) LEnd Sub ) S# L, ^. X) N" k: o$ V6 ~! z
  8 Q2 K- K) A2 s* w0 }! \
'*********************************************************** 9 R9 l( I, X& |) l$ t# l4 Y9 a- a
'* ValidLabel $ |0 n* [3 c2 _/ n
'***********************************************************
7 z, U' ?$ L$ c6 x. @7 RPrivate Function ValidLabel(byval label) # ~- s. A3 Y1 k- i
   dim i, lbl # q! A8 d8 l* q3 O9 m* \# `: k
   i = 0
% Y: K8 r( A1 L3 ?, |/ G7 A" H   lbl = label * ?6 H+ [: o& j! o
   do 5 X8 r5 D) |& {# f* _) p1 \6 w
   if not dbg_Data.Exists(lbl) then exit do * F: q" m" a5 [' z" y' h
   i = i + 1 & h* x& ?% x7 V" t" O: z
   lbl = label &amp; "(" &amp; i &amp; ")"
$ O1 k& @7 f4 [   loop until i = i
  f4 J* |5 z/ ^  
0 r$ c+ v- \. y1 K9 H$ F4 ?3 o   ValidLabel = lbl
) ~4 s5 i& m4 ^End Function ) G3 g3 `( V; k* K
  8 X6 a! U+ l) q) z  B
'***********************************************************
) p. T% b8 I8 q" x$ W'* PrintCookiesInfo 5 ~9 B' H1 f; R0 J0 F7 `
'*********************************************************** ! U  J" T7 x! F9 ^
Private Sub PrintCookiesInfo(byval DivSetNo) 8 \# p2 ~4 y8 l4 h8 x
   dim tbl, cookie, key, tmp
  B6 F6 C' x% k   For Each cookie in Request.Cookies 0 Z1 X+ s7 _  [+ o, |# i6 P+ l
   If Not Request.Cookies(cookie).HasKeys Then
0 n* N2 x! e5 K# t$ b     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ' f& E5 }. E1 d7 C3 x5 W$ X
   Else
: V9 b4 p0 K6 P; F+ `& m     For Each key in Request.Cookies(cookie)
3 E: r* _* A0 p     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
% V) Z3 S: l: _3 a% j. I$ g3 pCookies(cookie)(key))   
; T1 ~8 i, e; z- J7 i& {7 l   Next
8 E( u; H* i9 Z6 x   End If - @6 H5 w: g" R; J1 G; K7 |. p
   Next </P>
4 m% \3 J8 L3 _& V$ @8 {<>   tbl = MakeTable(tbl)
  q( @% }8 h) _   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ( w0 d6 X/ \7 ]# V3 ]
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) $ s; `7 S" q: \" l, ?; M
   Response.Write replace(tmp,"|", vbcrlf) # y$ \; D2 ?1 A# r4 v
end sub ) b, `9 d( }% L- ^
  
. m8 _; t. p% C4 P  Z- o6 w! i'***********************************************************
) N& H; F1 e  ]$ @/ F; z, O'* PrintSummaryInfo
, `5 A6 X3 Q! L'*********************************************************** 0 y, E2 k4 h- f8 Y6 q$ p! i
Private Sub PrintSummaryInfo(byval DivSetNo)
+ t7 y8 W" O) I( r+ q8 e+ S   dim tmp, tbl
2 b8 z3 H8 m( c$ t5 X   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
% `$ s' W0 U+ y# d3 h   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 0 s7 K* z5 `: k: `  f
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
+ \% a& A% V! q$ g: A8 h   tbl = AddRow(tbl, "Status Code",Response.Status) ' v/ ^/ V/ g' D' D9 u
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) & M0 ]4 _0 {9 I: D* [
   tbl = MakeTable(tbl)
( l9 f# t; Z1 {3 j+ k/ Z   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
: b$ ?: v% `, u' \   Response.Write replace(tmp,"|", vbcrlf) 5 O2 N# ?) O. ?& N
End Sub </P>
- m$ j5 G  ^7 M) Z" n# p: b# `<>'*********************************************************** : q& H& J% S8 q; W. @  j, w
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information - |5 Z2 g, b5 S6 u5 g% ]
''@PARAM:  - oSQLDB [object]: connection-object   ]5 V& R, @, b- G5 O! n
'*********************************************************** " o$ a2 x* {) T: r2 A) t
Public Sub GrabDatabaseInfo(byval oSQLDB) . h4 v' W) W% s! E9 Q
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) + V: C- [) P: @9 J
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
# R  F: {8 z$ ~: k   dbg_DB_Data = AddRow</P>
作者: 韩冰    时间: 2004-11-21 11:44
(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") &amp; " Ver: " &amp; oSQLDB.Properties("DBMS Version")) 8 W$ Y8 O4 ]/ o( o0 X3 T
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
7 J6 ^' q4 ^8 k# i6 `End Sub <>'***********************************************************
8 s7 {7 i4 [/ F! V, o( w'* PrintDatabaseInfo
3 M) Z+ N/ Q) f' r4 d'*********************************************************** 4 E8 j3 ^  R# N* [0 _
Private Sub PrintDatabaseInfo(byval DivSetNo)
, e/ c& f& i9 \( R   dim tbl
' g1 m+ m! s) R; A$ C5 ]. u   tbl = MakeTable(dbg_DB_Data) " N5 U  H( |) o7 {1 r* ^2 x% u
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 6 M  M. d* C; @* _5 ?0 b
   Response.Write replace(tbl,"|", vbcrlf) 4 ~; a5 |5 b, S
End Sub </P><>'***********************************************************
% r6 x6 O$ h0 m'* PrintCollection # `- {1 j8 _9 N" s3 r7 ?
'***********************************************************
( d4 O; {) G( f$ W5 t) L" C7 DPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 1 C8 d& O+ y( f
   Dim vItem, tbl, Temp 6 y! u+ J3 s0 `  e) I
   For Each vItem In Collection
+ {& {8 ~8 k# A/ r3 A" ?     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
8 r1 I6 F, v  z' X! y% Q  L       tbl = AddRow(tbl, vItem, "{object}")
" m/ h. J  d1 G, |2 v# _0 D     elseif isnull(Collection(vItem)) then 7 B* r+ x$ z+ z& F5 m- b
       tbl = AddRow(tbl, vItem, "{null}") ( Y& ]6 g; _3 ]
     elseif isarray(Collection(vItem)) then
  z' A  z+ Y. i9 ~       tbl = AddRow(tbl, vItem, "{array}")
& b* D6 F8 i& _- N! W     else
+ Y# M$ `+ |, K, S# I8 {3 }) p; O& i       if dbg_AllVars then
9 ]2 V$ k' z1 s: P7 {       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
. y! t2 ?0 R! V- b. k: J3 ~4 k     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
# E) u# J8 E' v; m. r       if Collection(vItem) &lt;&gt; "" then
4 s) S3 V! b& v' B( q/ D1 e  o& T+ X       tbl = AddRow(tbl, vItem, server.HTML  X1 ^6 f9 P1 E# a3 G5 q  ]
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") $ ^6 B1 P, B1 c+ @4 P! N
       else 5 d' ^, x1 B0 K1 R. \
       tbl = AddRow(tbl, vItem, "...")
& _* ^# w5 `+ b3 A  l/ B       end if 4 q4 [1 z. G* L2 T* W
     end if
1 a3 Q! ]/ b. z; z% |2 o   end if
8 V- P/ Z; W, S% r2 ~/ \. ^8 F   Next " l! [; l* f  C) I4 Q' C4 M* i; U
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
' h  L' `. U8 V; J) H9 J& j1 Y   tbl = MakeTable(tbl) 9 G( o6 z. b9 i2 z7 w
   if Collection.count &lt;= 0 then DivSetNo =2
% n: K1 r$ d3 C7 I     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
, ]/ ^, h$ J3 w, g5 O! v     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ; R0 o8 E+ a/ |5 H/ |7 K: J
     Response.Write replace(tbl,"|", vbcrlf) 5 O, B& _/ w' R& [9 p
End Sub
' ~, C) r0 {# R* L. P  6 _  ]( ]6 w5 b+ X8 y4 ~7 J
'***********************************************************
7 D2 i, R+ ~5 t. {, Z'* AddRow
* r5 o4 j& ^9 Y4 E* l9 j* q7 q'***********************************************************
) ^, s4 ^# f3 ]6 @  B% hPrivate Function AddRow(byval t, byval var, byval val) & N) B. w0 k; f( ^0 t$ Y3 k
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
9 |& p. u( g; Y3 R   AddRow = t
" e' g; z9 W% j. ~8 _End Function </P><>'*********************************************************** " I4 g  p  @- G8 ?
'* MakeTable ! ]$ A7 B) t2 o: q
'***********************************************************
/ R- f) U" C0 v; q+ _' `$ F. @Private Function MakeTable(byval tdata)
* D/ d0 s: @1 d- o6 t* j  z* I   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 2 A! U( e, @1 D0 M
   MakeTable = tdata ; c' E( B9 @  N4 Z
End Function </P><>'*********************************************************** ( o& B$ r7 J* N9 d# m& x, X9 [
''@SDESCRIPTION: Draws the Debug-panel
( v4 F" h4 ?# D$ U8 S# x'***********************************************************
' ?* r" G& T, b& Z7 sPublic Sub draw()
! t, W# x; i3 S0 E& f$ Y4 U   If dbg_Enabled Then " i7 A# b5 S- M# r
     dbg_FinishTime = Now() ; c, g2 x1 u! M& l4 h0 M
  4 \% z6 g8 z, r  Z- l
   Dim DivSet, x
+ h. P; W1 w3 j) v   DivSet = split(dbg_Show_default,",") - D' w( o1 {! U7 ~! c
     dbg_Show = split(dbg_Show,",") 5 Z, T/ A) d- n0 I. H
  
7 c/ k8 T9 I! Y3 g' |+ X. _- v   For x = 0 to ubound(dbg_Show)
8 R' l  x) \# F% Q     divSet(x) = dbg_Show(x) 5 Q2 D- ~) J% X4 S4 ]
   Next
9 j( }, i% `6 T* V- r  
* J0 o' Q  j4 s" d/ L   Response.Write "&lt;BR&gt;&lt;Table width=100% cellspacing=0 border=0 style=""font-family:arial;font-size:9pt;font-weight:normal;""&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV style=""background:#005A9E;color:white;padding:4;font-size:12pt;font-weight:bold;""&gt;Debugging-console:&lt;/DIV&gt;"
! `) I# E6 ^' r' A   Call PrintSummaryInfo(divSet(0)) ( Y. n( @; A- C4 z6 Z
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( Y$ p9 p) q: S6 D" `8 o% z    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 8 @4 Q4 D* _, a
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 4 _  y2 }. Z: D5 v( w- x6 a
    Call PrintCookiesInfo(divSet(4)) $ S; x# f/ a7 L' H2 |2 r
    Call PrintCollection("SESSION", Session.Contents(),divSet(5),AddRow(AddRow(AddRow("","Locale ID",Session.LCID &amp; " (&amp;H" &amp; Hex(Session.LCID) &amp; ")"),"Code Page",Session.CodePage),"Session ID",Session.SessionID)) # u7 d+ l/ ]5 X% r' S3 B2 m/ Z- e9 ~
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") , }7 R0 e1 I. C% N7 K3 d  O0 M$ U$ |
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 1 M3 V+ W' s( R8 Q# g# R
    Call PrintDatabaseInfo(divSet(8)) " F, y3 x( ^( j- W; N
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
8 ?% P1 Q/ p1 Q4 r( l' `( C2 J2 N1 i    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
+ w1 Y' C0 l' f. }: ~7 l3 V    Response.Write "&lt;/Table&gt;"
: j+ e/ `, \6 A2 U9 }! z/ K   End If # Z# |# ]# A" d
End Sub </P><>'Destructor
; {; O5 e$ t7 M$ e" T1 TPrivate Sub Class_Terminate() 1 F4 `2 k. t4 `2 b1 ~9 J5 a) I
   Set dbg_Data = Nothing ) r$ E5 G2 j; G& W/ T
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>$ Q4 c* I5 s7 r! @- X
CLASS debuggingConsole 8 o* i1 w) c0 O
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
$ A4 z  y$ S( D. F0 H# g$ S# C&amp;n# o8 s# ~* Q6 p" o3 X0 K1 f6 s$ i# D
bsp; * L: t4 o( X% p- i. k2 ?
Property Get Enabled===[bool] Gets the "enabled" value
0 u; }- X! B3 }& ?  
2 ]2 D0 {0 v# M9 Q. C, u4 v& xProperty 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
0 w. V5 N# ]+ ?7 G/ l( X  
% n! U% n% |7 FProperty Get Show===[string] Gets the debugging panel.
) ]8 i4 ]- T5 `* u3 Y8 W8 b% E  " ^9 H1 l/ {3 b5 Z$ ~7 }' L" k0 p2 E
Property Let AllVars(bNewValue)===[bool] Sets wheather all variables will be displayed or not. true/false </P><>roperty Get AllVars===[bool] Gets if all variables will be displayed.  </P><>--------------------------------------------------------------------------------
; ^8 J! z4 x+ }, A7 x" ePublic Methods </P><>public sub===Print (label, output) $ S, t( y2 B' F$ @- K$ K' a
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) # g2 p1 j+ o5 `8 a6 l
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
$ y$ f  Z+ p& A4 c* z# @% W   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- . V1 i: f1 K0 C* h5 Y' K
Methods Detail ( ]8 W/ l& Q2 R9 V2 W6 n" `
  ; |. x, Q0 A- T* e$ ^$ o
public sub===Print (label, output)
5 m2 l: D! p9 k% B1 g; k7 z* bParameters:  
+ M7 Y7 X; \. w; f$ T, W! Z. \7 A3 a   - label [string]: Description of the variable
7 e  m9 M: v! ?! c* w4 O   - output [variable]: The variable itself 3 L9 Z3 Q$ L3 @" \' X7 }9 l+ j# q
  
6 `5 _0 ?, q: i0 X) P' epublic sub===GrabDatabaseInfo (byval oSQLDB)
; M3 C; b0 J# T) EParameters:  
* Y$ N$ ]% H# W, W   - oSQLDB [object]: connection-object</P>




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5