数学建模社区-数学中国

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

作者: 韩冰    时间: 2004-11-21 11:43
标题: ASP中令人震撼的Debug类(VBScript)
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
7 {/ }7 V* q1 F8 X% [' U<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
; q8 u8 `/ P0 L- ?. L使用方法很简单: 1 [# s3 W7 s2 H6 t  m1 |5 Z. s9 T
test.asp </P>
* e2 m5 D. P' ?) D; B+ ?<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ! t5 m- U6 Y2 z" }+ \6 d
&lt;%
4 @4 x4 p4 Q# Soutput="XXXX"
6 }% R+ W" ~9 ^+ @" @, ]3 B2 T( BSet debugstr = New debuggingConsole
1 w4 @+ A8 D: s4 m, {  x; wdebugstr.Enabled = true
* f" Z' w" l( ~. D  U7 a7 g! @' Q   debugstr.Print "参数output的值", output 7 {, C: H% A3 i/ G
   '……
% T$ }) Z5 [# `& h   debugstr.draw / Z" \: a. ?: e- J
Set debugstr = Nothing
& O( U# f8 Q& B! b. B' z: Z%&gt; </P>5 {, h' X# a( ~& Z/ M0 X* c
<>=================================================== </P>! t8 A2 z& ]' L% I
<>debuggingConsole.asp </P>" j/ @5 o6 E5 f8 H6 c: B
<>&lt;% 1 Z4 r# d% ~8 h
Class debuggingConsole </P>
3 }1 e" d& c0 x0 U& }<>   private dbg_Enabled & Q2 S8 }# j, [/ H8 T& L9 Z7 i7 o
   private dbg_Show
: ?7 P! m% j! ]$ ]' P   private dbg_RequestTime
2 m/ G6 j; o. M   private dbg_FinishTime
% g; `) t( o& m$ m! C% y8 [   private dbg_Data
$ W( ^" H8 H3 I) S' Y# C   private dbg_DB_Data
0 Z2 Y- d; `1 a0 V   private dbg_AllVars
( e, U& F9 o  @6 I   private dbg_Show_default
6 }+ ?$ C. Z( Y) X5 w8 q& h% V% J   private DivSets(2) ! h  u* I' Q  V/ ]" T
   
% `4 v  t" e+ `" t" b'Construktor =&gt; set the default values
' Z9 ]1 i6 B1 p7 ^2 U6 JPrivate Sub Class_Initialize() ; R! X' z5 h  c3 l; Y* V
   dbg_RequestTime = Now() : v0 `" D2 {( ?
   dbg_AllVars = false
( h. J9 M5 E/ G& M0 `* \   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
9 N1 k- ]2 @0 b2 e7 U0 ~9 |<>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 Z; Q! ]1 K9 }% x' L0 n4 j<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;* i- G- j$ U0 y# N+ T2 Q
&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># e3 ]0 K, \5 _$ K" n
<>   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>0 n% ^  V3 v* ^  K) o0 \3 a
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
, m7 F0 W6 z: b7 M5 `% V. S2 i2 @8 a1 HEnd Sub </P>
3 M$ b$ G) Q) w/ Z0 z, j( F<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
% a( l% M" b) _/ k6 \) V) K   dbg_Enabled = bNewValue
: d6 t! G, {& Z9 L- B% |1 NEnd Property </P>. q+ F. `; u& w8 l5 e
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
3 x5 C( U' ^* D, g   Enabled = dbg_Enabled " g' w, ~& ~: W7 Z2 @
End Property </P>
5 |" `0 _7 s" O* R. L<>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
   dbg_Show = bNewValue
1 n+ ^1 ?6 q6 N$ u2 p: CEnd Property </P>
0 d8 H8 F+ B9 z9 a4 S+ t<>ublic Property Get Show ''[string] Gets the debugging panel. ' |  l: W$ }. t4 Z4 i
   Show = dbg_Show ; ^" _! F' _+ a$ J% L" w: ]
End Property </P>7 U' f5 R5 @6 N8 I! t& h3 [
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ( A  B+ m& M; D3 [7 l1 }
   dbg_AllVars = bNewValue 1 R2 \8 S+ J% x
End Property </P>' [6 `  e. t6 {8 K& i' r
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
, ?  J) {9 W! U$ {" y, L   AllVars = dbg_AllVars
- d4 v4 k3 V( V" {End Property </P>5 u1 \3 ^* t8 y. Y2 }) {
<>'*********************************************************** ' d" R( n0 S  J
''@SDESCRIPTION: Adds a variable to the debug-informations. . b* W: P% j0 R( p/ o" `
''@PARAM:  - label [string]: Description of the variable
6 E% ?0 H; A* j$ Y9 ]8 i6 C''@PARAM:  - output [variable]: The variable itself % M) m4 @8 `  X0 {. d
'***********************************************************
7 T+ n' E, V: O' t/ A/ L# @8 W5 }Public Sub Print(label, output)
! Q  E* l& g3 ?* f/ ^3 K   If dbg_Enabled Then ; D' r$ s$ t: e+ S
     if err.number &gt; 0 then * h0 m7 `1 A4 z! D: v# T7 H
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) / N% V' W% z1 b5 o1 ^
       err.Clear
; Z5 T" I) ]+ U5 J+ {     else " ?/ x9 q. h9 j, k0 |
       uniqueID = ValidLabel(label) ! c4 S! ^1 b; a  ^
       response.write uniqueID 2 a/ V4 ^9 M1 ^: r
       call dbg_Data.Add(uniqueID, output) " i8 Z$ }: m3 w# Z0 i* }  t
     end if & l" ^& ~/ Q+ m8 s2 H+ N! C, P2 `6 ~3 s
   End If . D7 y' E4 P. W6 V" `! V3 h
End Sub , c& i' ?. X. x
  3 I- L$ X4 b8 i2 B% D) }6 y
'*********************************************************** 2 F( b2 C9 v& R# x
'* ValidLabel
; r; _0 n, M' u) `2 ~: q, e'*********************************************************** ! Y# o# ?4 q( r# {# t: G
Private Function ValidLabel(byval label) , ^$ x. j# S; g5 U4 `
   dim i, lbl " W2 G6 ?; J  X. W
   i = 0
0 h( r; v7 p3 L( x   lbl = label % c# l; T' y3 X" {
   do
7 ^5 i3 E" G0 _  H) D" R8 ]   if not dbg_Data.Exists(lbl) then exit do " k8 v! U9 \/ M, a7 m
   i = i + 1
9 G# ~' i  X7 ]7 A   lbl = label &amp; "(" &amp; i &amp; ")" * a$ r$ F2 {0 X. L7 E! X
   loop until i = i
# i9 \% _3 d' A3 `) A- n3 k    Z/ r+ J5 _- v% [
   ValidLabel = lbl
9 H, `4 N5 a' b' h0 O! E7 [  I  ~End Function
. [  H% ]  ~+ n9 f0 [" ]' C* n  
. T/ B: _' K7 k/ _8 ?  C/ Q'*********************************************************** 8 M6 A, m0 x/ ?8 m4 K4 k; a
'* PrintCookiesInfo
! p$ G4 ?4 K8 J( O: q; L'***********************************************************
3 m. [, |4 A; D  c# O- ~Private Sub PrintCookiesInfo(byval DivSetNo)
& `& ]. y! P' P: b5 o- i+ M   dim tbl, cookie, key, tmp 5 k9 [6 c. O) Z; U  {
   For Each cookie in Request.Cookies
/ }. g7 W" L+ G4 b. X   If Not Request.Cookies(cookie).HasKeys Then ! ]' n* ?% s% `7 G
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
8 w1 ?0 K/ |4 }! j7 B   Else # q  h. I1 y( V* i6 z3 U+ k2 b  _
     For Each key in Request.Cookies(cookie) 8 [! ~+ i3 _: I; d4 o6 H8 S& ^+ z
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 4 T, W: N# i, P, ^; N3 O% u5 @- @
Cookies(cookie)(key))   
. g1 q$ l) u) Y) y* b! N% b1 M   Next
! a6 X% E. F$ |8 T  u5 t   End If / J% n; `) k  M& K4 d& d
   Next </P>
$ M% Z3 M* G+ M2 n<>   tbl = MakeTable(tbl) ' d4 P- c# p6 N- M" {$ e+ a, H
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2   d5 l  [& @/ [# a- u1 w: u
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) : |& i2 U8 u+ k' p  ?! C' Q7 y/ V
   Response.Write replace(tmp,"|", vbcrlf) 3 X# g& d$ ?6 u9 a' p* k
end sub , X1 {' R  M. e( n4 `( b6 I
  
& \4 |( ~; K2 Y3 q) w4 P'*********************************************************** ( t% v5 F  l! O8 c4 L. A2 n5 y
'* PrintSummaryInfo . ^  o: [- U5 N  N+ B. V
'***********************************************************
! B/ l: u# s8 D% Z; UPrivate Sub PrintSummaryInfo(byval DivSetNo)
7 K) F5 T' h9 S- K. y   dim tmp, tbl
4 c5 O$ P* }* ~( I, g% k   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ! ~9 s% m6 k  |. j' k" p7 ]* v
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") % ~$ `  u/ R# ?$ Z: m: P' X
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 6 q, M0 B+ Q% w  l
   tbl = AddRow(tbl, "Status Code",Response.Status) " l9 ?" q" ?. i+ u
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
8 T+ P( w# O% V6 F8 J   tbl = MakeTable(tbl) / x- g' [; p6 V+ O- F! z  U) f, Q. m
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ; s8 J! w0 v- |
   Response.Write replace(tmp,"|", vbcrlf) 6 Y1 V) d% N" }0 E6 H8 X
End Sub </P>+ Y0 _, _' ]6 g5 w' L( u' j
<>'***********************************************************
% e, K# r( P% c2 [8 Z' \0 o! Y''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information . o6 f( g5 T! g
''@PARAM:  - oSQLDB [object]: connection-object 7 }$ ?0 [$ U  W9 i
'*********************************************************** 6 a$ s  F* t2 s6 t/ ^
Public Sub GrabDatabaseInfo(byval oSQLDB)
" @' Y6 o3 W& v$ t+ ]: I+ E1 C   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) , s- t6 m& k1 T; T
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) / E- v! ?) a8 `; s: W+ v
   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"))
0 W9 i/ t* O1 P6 s& L6 W   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 6 m  N9 \# i+ |$ ]8 e% _
End Sub <>'***********************************************************
1 E, J+ Y$ f& {4 M3 P'* PrintDatabaseInfo
, E( E3 d5 O+ F" b% ?/ u'*********************************************************** + A  m# O4 J3 N+ d% ?! }7 h
Private Sub PrintDatabaseInfo(byval DivSetNo)
( |# G2 n( G" `+ W3 r0 |   dim tbl 4 K$ K( P3 l* r, k& ~5 g. p4 C/ E
   tbl = MakeTable(dbg_DB_Data)
- E; A1 ~/ i! ~' M   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
7 P& _3 h7 E$ J* a8 O- M" V0 o   Response.Write replace(tbl,"|", vbcrlf)
0 O! X* m  h7 L" _End Sub </P><>'*********************************************************** " I2 e# f0 v: U! J6 d+ b+ W
'* PrintCollection 6 i1 Y* W5 l. x
'***********************************************************
/ {# m6 f1 A2 t, w* ~4 s: f6 iPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
* T2 k1 R5 y7 R; v$ [8 r; w   Dim vItem, tbl, Temp
7 l: y0 E7 ?! X! @, M* q7 N   For Each vItem In Collection
9 L: h2 ]7 e7 Y! k     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
7 b9 \# K; W/ B       tbl = AddRow(tbl, vItem, "{object}")
) N  x6 }% r& C' _9 a% L) e1 t     elseif isnull(Collection(vItem)) then " T, K: O& w" ?; ?6 D$ N
       tbl = AddRow(tbl, vItem, "{null}")
7 D: r4 c: a' U) N7 c, g& G6 R     elseif isarray(Collection(vItem)) then
1 o' R2 K% \1 g. k2 E4 a0 j, E# ~       tbl = AddRow(tbl, vItem, "{array}")
- _2 G2 B6 j. G# D0 N( \' {9 k     else
( ^# x, J' j7 `) l: J4 {       if dbg_AllVars then
6 a) w) h  a7 G$ K( k       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) , b- W  J# |4 U6 _  p
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
7 b7 i! x" ]5 o# v( d. a2 n       if Collection(vItem) &lt;&gt; "" then
. _' m4 A" b+ P, S5 h7 w6 c' {       tbl = AddRow(tbl, vItem, server.HTML
, U9 x; r9 K, GEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") * S  D( X+ g3 Y3 x
       else 0 i3 Q) o! p$ J$ ^
       tbl = AddRow(tbl, vItem, "...") 6 t2 D2 c8 q/ D+ K
       end if ' f% t& P1 N4 b; K/ s: y$ L+ B' K
     end if
) m7 y! f1 t0 Q1 L- k   end if 3 O( V; H9 p" M0 Q8 h! \# ]$ m
   Next
7 x2 g: G/ w$ T/ r* j, n  ^1 J   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
9 e- S7 }7 r* f3 G: ]$ U: N   tbl = MakeTable(tbl)   g3 l' R+ f7 u! X( D; x4 p
   if Collection.count &lt;= 0 then DivSetNo =2 2 ^" O8 T7 a$ Z5 Z6 r& @
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) " x' s% Y9 I  H# @+ P  ]* p# s
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
/ ^& e$ S" z/ r; x0 w     Response.Write replace(tbl,"|", vbcrlf) 0 W8 g9 l; l$ E2 B
End Sub + I0 p: ^8 H8 A
  # W+ c2 j4 j6 E1 F8 B
'***********************************************************
1 l9 D8 x5 H( ^, E8 o# V% V$ s'* AddRow
$ R, q  f/ L  ^5 h- R- T. S# A'*********************************************************** 6 ~6 w! u. _2 r3 q% {" }% l7 }
Private Function AddRow(byval t, byval var, byval val) - U5 q* l* y- {/ D) ?5 e0 k2 F
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 4 R' E$ f* Y# B* w, r6 Z" x# G6 _% i
   AddRow = t
- u  N; q2 w! Y. k& }$ z6 b0 ~) cEnd Function </P><>'***********************************************************
5 P* j7 N* T: T. H& X( ?'* MakeTable , v- U+ m% b" g9 `" d
'*********************************************************** 7 d+ s) s  t# Z6 c5 o
Private Function MakeTable(byval tdata)   R+ N; x- I; N3 m" B' r# V" t: A
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 8 l  k' d3 Z5 k+ n# `
   MakeTable = tdata # N+ J9 j7 p# x# T8 ~1 [
End Function </P><>'***********************************************************
# p; {" D/ [6 p; d2 ?+ c3 y''@SDESCRIPTION: Draws the Debug-panel ; b; i, ?" }5 }9 l
'***********************************************************
) k+ b0 z/ u  WPublic Sub draw() 9 o+ B0 d0 k# O7 |
   If dbg_Enabled Then - o! [9 W( _# K9 j! [" G
     dbg_FinishTime = Now() 5 @5 g$ E& m* b
  
1 h# _5 [7 X0 T7 ?- V3 e   Dim DivSet, x
, e% o! ]. V) K   DivSet = split(dbg_Show_default,",")
: A3 P; `" U; k     dbg_Show = split(dbg_Show,",") # f& g% q( b7 S* M4 f6 z4 D
  $ x+ q' t* g. v) F
   For x = 0 to ubound(dbg_Show) 1 C5 Z6 D" Q( C5 l9 k  ~  w
     divSet(x) = dbg_Show(x)
' }0 P0 @1 T% O4 ?. }   Next 1 U- L6 R1 z; h" ^/ Y$ Q% v
  
9 W7 w$ ~. w0 A1 N2 K   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;"
5 |  ?" v% ~) m, i   Call PrintSummaryInfo(divSet(0))
+ J- Q& ?: t  P; L     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
7 J% F4 y" V0 q. p9 F    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
) X  @9 [+ S) {+ m( r    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
2 \4 D- j+ d! \1 q( Z    Call PrintCookiesInfo(divSet(4))
' R4 f1 L, b$ M3 ]; [3 c    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)) 1 e+ P1 k; A) F/ n6 \$ X* ]1 f
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") # M  v; M6 ]4 J3 ^& k
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ! F% n9 f( _" S# k" m& m( w
    Call PrintDatabaseInfo(divSet(8)) ! P7 p( j  R5 b$ j
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
9 u  ]/ b: C9 U1 U; M    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# R! D, X9 M4 J- X! v    Response.Write "&lt;/Table&gt;" 2 E8 p+ D% I' ?; V+ q/ r6 C
   End If * R6 `$ b# d- n) ?2 V
End Sub </P><>'Destructor
, f$ f  I- Y4 t# q- ePrivate Sub Class_Terminate()
- `: v/ d5 j: i1 O/ N) ?8 C   Set dbg_Data = Nothing
' ?3 ^  A% C; s) n0 NEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
4 i4 C0 ~' k' v/ x6 n/ UCLASS debuggingConsole 9 Q; |6 z) k8 @
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 {7 r  K  }( Y% T  F# t&amp;n9 D% G2 a6 |( n: q. ?. ?
bsp;
( Y6 y/ q, F( ]Property Get Enabled===[bool] Gets the "enabled" value : A- V0 s! b/ y
  
  m6 h& J' g5 t. Q0 n) J8 cProperty 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 1 d% ~% U4 d6 D- v. c
  * o% j" r- G/ Z5 T; n- K
Property Get Show===[string] Gets the debugging panel.
6 C8 T0 ?. r% x! L5 m* _! D9 \% [0 J+ ~  
& K& x6 ]6 _$ r5 c5 s  J* I8 @- w! {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><>--------------------------------------------------------------------------------
' c% j# K: {7 B% q! K2 x4 }7 xPublic Methods </P><>public sub===Print (label, output)
% {2 q" _$ D5 P/ g/ W( ]6 z9 b  O1 t   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 9 t- i  W, ~* Z' j
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () - I1 s2 j! ~! f2 v( d6 c& ~6 J3 v
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
" \5 ~) r9 V& G2 ^$ VMethods Detail 7 R1 A% E7 c5 u) R
  " U  X  `" G  N9 Q
public sub===Print (label, output) 0 L# r& J3 V' S9 i) z
Parameters:    I% x- K' A, W
   - label [string]: Description of the variable - {* R2 l  y- K' m
   - output [variable]: The variable itself 5 q4 u, c9 k' g: P/ a: F8 V* E
  5 G! W) h0 ~' b6 ?. T
public sub===GrabDatabaseInfo (byval oSQLDB) % [: z3 Q8 q4 i) F- K
Parameters:  
* o0 D% g- V, |$ Q5 m1 S   - oSQLDB [object]: connection-object</P>




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