数学建模社区-数学中国

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

作者: 韩冰    时间: 2004-11-21 11:43
标题: ASP中令人震撼的Debug类(VBScript)
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P># _% c4 x+ }8 W
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 1 D' n7 W  {$ N, ~1 E) @! [- D# @. T! ?
使用方法很简单: / v2 u: I) p; p/ |9 U
test.asp </P>
7 w! }8 r$ A  S9 u; U9 p: C<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
4 [* G& o; A: J&lt;%
; f; `. t/ a+ {/ M# X3 t/ A1 Eoutput="XXXX" ; r, t6 z0 N3 s! J. g) m5 d
Set debugstr = New debuggingConsole
" h! q/ }1 F5 q1 T& d6 x# ~6 |! Edebugstr.Enabled = true 8 g$ w4 y8 B2 M8 D
   debugstr.Print "参数output的值", output
. _5 O9 s/ P2 _   '……
8 [, l! R7 x8 f8 E  p9 D5 s   debugstr.draw 9 x' W  q6 h, `- Y; ?5 _
Set debugstr = Nothing
6 @; o  a) _0 i* n2 v" S%&gt; </P>
0 J; I3 M( Z9 T' |$ X8 d<>=================================================== </P>
: G7 k8 m7 E+ U, @* ]& v<>debuggingConsole.asp </P>
( g1 O: o2 v. L' A% R<>&lt;% % }' h& p- }9 i' X: }  F
Class debuggingConsole </P>
" ?$ G& ]& D( Q: o* K% [+ R, ^/ N<>   private dbg_Enabled , k- `/ [  G9 g
   private dbg_Show
0 `/ L' A2 a9 P5 X; x   private dbg_RequestTime
: [6 o5 K. s0 o/ f2 q   private dbg_FinishTime % ~: U. s' Q9 ]3 V: v" g! f/ X& R
   private dbg_Data ' o9 `# A: P1 }7 H
   private dbg_DB_Data 7 [+ q% g9 o- Q# ]! C& e8 U. y
   private dbg_AllVars - C1 j2 h3 [$ I- ]
   private dbg_Show_default
. L8 B! }) ?$ z, h# Q( S: t   private DivSets(2) ( J2 p: Q2 j# C# \  Z
   ; g$ N4 w2 g- S* B; F: l# l2 h6 ^
'Construktor =&gt; set the default values 0 A6 K' i. k1 X. E' V4 R$ H
Private Sub Class_Initialize()
) \/ w5 @8 G& e   dbg_RequestTime = Now()
5 H( I% D4 Z& d- m4 e   dbg_AllVars = false / C& o- s! x5 d/ O9 r  ~8 ^
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
  }* b) I! V, h- n; A3 b<>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>
8 S; q; B+ F% [<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;/ ^! Y! H" f6 e+ B5 p- E* {$ W
&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>% h3 ?0 j# e) W" g3 W; F9 h- M
<>   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 o, T9 u' R  Y$ j: }% t3 U% S
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 9 `! Y7 i0 f) t. j* e7 b$ ~7 E
End Sub </P>% N2 o0 S1 `, X/ G8 V; B; C
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false - M& `! M$ j4 H. k. e( X2 `
   dbg_Enabled = bNewValue
7 _8 k. W2 X% |6 d6 t+ C/ v: LEnd Property </P>, m7 J: [3 {" F0 h
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 4 Z8 {0 L3 c8 L3 |: j
   Enabled = dbg_Enabled . `) H  M* [; d
End Property </P>1 H0 r5 {4 D0 P
<>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
" p/ R( [# S1 R8 w4 d* Z   dbg_Show = bNewValue ; O. V$ T; G# b3 q$ h. B2 G7 i& U
End Property </P>1 A* ^6 u3 X- M' B5 l
<>ublic Property Get Show ''[string] Gets the debugging panel.
' L' V8 Q# S0 C/ G4 h- ^, l4 D9 J   Show = dbg_Show 8 K4 K( V; H2 ^( ^2 E% H
End Property </P>
" a4 N3 J+ ?) Z# g<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ( V6 x- e* ^- Q* v: s
   dbg_AllVars = bNewValue
9 \4 v# Q8 Q  M' g0 t% k8 o9 T& f' EEnd Property </P>; p- w5 i1 i+ y) e
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
* v5 y( C2 B5 v, U0 t7 `& A. l# ^   AllVars = dbg_AllVars 1 d0 d+ U. v2 x# E% i6 s' v
End Property </P>
$ s0 y$ c" C1 _) H( w$ H<>'*********************************************************** 0 N& @7 ]5 \' U9 U
''@SDESCRIPTION: Adds a variable to the debug-informations.
9 x4 `8 _1 g2 S% `5 Z' \''@PARAM:  - label [string]: Description of the variable
+ C6 b) g# m& t0 P0 J''@PARAM:  - output [variable]: The variable itself . E' r) N% V1 C3 L9 R, y) t
'*********************************************************** - Q9 Y5 t' p- V5 n5 V! r
Public Sub Print(label, output)
1 c# k$ m5 D/ M$ \+ `6 C9 p, F   If dbg_Enabled Then * `' @5 B& F; X8 V7 ~$ u8 r
     if err.number &gt; 0 then 0 B8 ?, g, r+ f+ }
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 4 L* p: j; e3 S5 B+ Z9 k1 R: ^! g7 i
       err.Clear 8 T' t% o9 I  m
     else
& ]: M& k3 I0 q4 G       uniqueID = ValidLabel(label)
- q1 @: a  P6 k       response.write uniqueID 4 C. P: `8 x* Q; i% q
       call dbg_Data.Add(uniqueID, output) + ~6 e; Q/ U! N; }1 }
     end if $ H" P0 w6 l7 h0 H
   End If & Y5 x$ I7 F, {0 z( x/ S) h
End Sub ; I  J0 E& M( U  g% l% |# ?
  
! A# d) d8 {' ]+ ['*********************************************************** , n* S) ?4 ~( a% ~* F* z6 R
'* ValidLabel , E7 t& V& I# Q5 |1 N1 [5 r
'***********************************************************
- v3 Y+ C4 b) `5 K: F# ?Private Function ValidLabel(byval label)
0 p* C: {! P, O% l& H. Q3 a' j   dim i, lbl 2 V5 K# v0 f6 J# o
   i = 0 9 M+ o- _! q6 X% K3 k4 A1 L1 W
   lbl = label
/ B; j1 ?, @1 |3 ]! ^% n2 S; r* F   do - ^  a) _$ y# G$ w# p
   if not dbg_Data.Exists(lbl) then exit do
7 m. e6 J& s2 w' e9 N1 [   i = i + 1
2 L9 K1 d/ y9 Q   lbl = label &amp; "(" &amp; i &amp; ")"
. p% F7 F+ u* S- l$ U   loop until i = i 2 r" O0 d( l' y  M" R  @
  . e" c' _$ P' k# c: _
   ValidLabel = lbl
* ~* j4 q# x& [End Function . ?7 h) y- k* J% C+ `: g
  # R! G6 [2 i& Y3 H
'***********************************************************
8 a, `% J. ?5 I7 Q( x" ?'* PrintCookiesInfo * |3 l: u- p) T  m
'***********************************************************
- x) f& m% }2 F& _) [9 Z% G* H4 LPrivate Sub PrintCookiesInfo(byval DivSetNo) ! S) c+ n+ ^0 r* g* D
   dim tbl, cookie, key, tmp
) Y/ L3 E" S5 F! I   For Each cookie in Request.Cookies
0 M2 s& S! e( V% Y# H9 g   If Not Request.Cookies(cookie).HasKeys Then
* @2 W- M% ~2 `2 H5 r     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ; z' v4 N% T. j$ @
   Else   B, _7 M/ \2 K. _3 x) s: [# X/ P
     For Each key in Request.Cookies(cookie) 0 ~5 H7 i0 v# e: G; F+ y
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
2 N) x/ \( x8 m3 K! M1 `5 m( yCookies(cookie)(key))   
; c3 J$ B. y& M2 r  \. A3 K" R   Next
2 j- P# n. `+ k3 e   End If   o" C. M$ E* z0 p
   Next </P>
& W0 N0 s) F1 Y" W. V  D<>   tbl = MakeTable(tbl) 2 E8 Q4 ?: a( p0 w$ L% U" i: O' a, U
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 + D: O! K2 {5 ^; Q( T! G; t6 z
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
4 x9 [4 w6 ]; Z3 N   Response.Write replace(tmp,"|", vbcrlf)
  K  p+ ~$ p/ e3 A( d* Y, Aend sub 4 s2 w, V% N/ b  h/ M# G: `: {
  
# Y/ o& d: g7 D/ C- l, c'*********************************************************** ; G9 [- F) e3 `& j+ f9 ]
'* PrintSummaryInfo
% T  c- B* `1 q" h'***********************************************************
3 S8 x6 |0 Y, M/ t& ]# EPrivate Sub PrintSummaryInfo(byval DivSetNo) 6 A) L1 v0 o. k( E  D, ?
   dim tmp, tbl
4 @7 R! Z4 S8 m! b8 Z3 F8 z3 s   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
$ h. e$ X( v4 ]   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 4 g5 U3 Q1 B  ~6 E
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) . ~$ D3 `2 b& y/ s
   tbl = AddRow(tbl, "Status Code",Response.Status) - v: Z0 _" c3 R! o- ^3 i! ]8 A( `
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) , N# t) G6 e/ w! z# ~
   tbl = MakeTable(tbl) " I  A0 }( ^# w$ r
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
. L8 o' x4 c: F7 U8 O   Response.Write replace(tmp,"|", vbcrlf) & n2 r3 I7 ?& J! U5 g- J
End Sub </P>6 K% r% D7 Q3 ~6 G
<>'***********************************************************
0 q* D2 n/ `* Q& F1 O% e''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ; G% O+ ?5 n& ?1 c4 A3 h- k  K
''@PARAM:  - oSQLDB [object]: connection-object 2 b) I6 s( {0 }0 x+ G7 L8 f# P( {5 x
'***********************************************************
# u. s/ p! }9 f) L7 i; U; {. APublic Sub GrabDatabaseInfo(byval oSQLDB) ( Q! {( j! A# a8 ^- B/ Z2 s- ~
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) / p8 @4 I& U( }( K
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) $ O+ _) o# I, P" `- p: v$ d/ j
   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")) + j1 m  G2 h9 O
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
- C- m% g2 c1 r, i* }End Sub <>'***********************************************************
7 Q- _; K; i8 q) p; n'* PrintDatabaseInfo
! `9 ]+ A+ }+ s, P9 [- a" O'*********************************************************** ; L9 p" w7 x! u5 q
Private Sub PrintDatabaseInfo(byval DivSetNo) 5 s& J; s; H( M1 }
   dim tbl
, z4 E! T% }9 _& D: N   tbl = MakeTable(dbg_DB_Data)
: r& l& [& N, h$ M$ [9 |   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) % r; L+ z% Z3 ~0 K
   Response.Write replace(tbl,"|", vbcrlf) # V5 ^4 W/ U3 y2 w; ]+ d
End Sub </P><>'***********************************************************
: G4 t' Z% F7 o2 a/ r  ]" F'* PrintCollection $ S- B4 P0 b4 _) S! U, @5 J  n
'***********************************************************
% L, ?% P6 k# Y& S5 F' }9 JPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 1 L9 _% \1 A+ R# Y. [+ t
   Dim vItem, tbl, Temp
1 y0 i4 s1 M6 F# Q2 x$ j' s   For Each vItem In Collection
) ]' _3 n/ c" ?     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
5 @- `8 j" O4 D3 j) n       tbl = AddRow(tbl, vItem, "{object}") % m+ H. Q$ @4 Z, T
     elseif isnull(Collection(vItem)) then
5 }! z; z: \9 D& i9 e) f7 X4 B       tbl = AddRow(tbl, vItem, "{null}")
8 ?  c8 z4 H+ a3 V1 t' I     elseif isarray(Collection(vItem)) then ) g& h2 ^2 O! w$ S  s* J6 z
       tbl = AddRow(tbl, vItem, "{array}")
, W3 b% [% ]! m7 b" V' q+ O     else ! ~$ l" p9 S# z1 e3 o/ U, M5 u; H
       if dbg_AllVars then
* X) a( `+ q# E       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 5 b! f: D% Y+ K4 O+ S$ P
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then & v( S" Q2 }1 _! Q4 ^  |
       if Collection(vItem) &lt;&gt; "" then
$ L, U: S- }! l* r2 s! d' K( o       tbl = AddRow(tbl, vItem, server.HTML
4 D, N1 Z) v  `0 iEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
, @1 y8 `. m, K5 q2 ?       else " N% N- a1 I- A
       tbl = AddRow(tbl, vItem, "...")
' N0 `3 k. A6 S* p6 B/ `6 K       end if , c$ q% R& A4 [& Z8 i
     end if
5 x3 A( z  M$ Z1 P- M6 i; h   end if   a7 T2 T' }" g. S
   Next 5 z8 v3 ~) J3 Q$ ~- D9 z" H/ m3 @
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ' I. C! _! Q, o& q$ E+ w( l- U  Z
   tbl = MakeTable(tbl)
/ x& F/ I! i4 x; T% c  d   if Collection.count &lt;= 0 then DivSetNo =2
+ Z) x7 N0 z/ x0 U8 |# ?     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
6 r" S# n% l0 K+ {: z! y& H1 H     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 7 Q) r+ a# g, v' ?- E9 W
     Response.Write replace(tbl,"|", vbcrlf) ' p( p9 i6 ~# z/ V$ V
End Sub
5 j1 h: k8 d0 t- {/ ?  $ c) e; Y* p- F) {, L4 P8 B$ ?
'*********************************************************** ' S. U$ G4 P# m( r6 ]. Y
'* AddRow
* _4 s0 C& G, J: p- P* ?'*********************************************************** ' g  ^( R0 L/ c5 @/ s& r
Private Function AddRow(byval t, byval var, byval val)
: t5 Y4 g- D( f' g2 Z   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 0 z& a5 l3 ^4 S/ }: Q1 |
   AddRow = t
( C3 y2 ?( U1 t8 D4 K" ~1 r( Q0 eEnd Function </P><>'***********************************************************
  L. Y( Z+ s& D' I- x'* MakeTable , D6 E/ M! Y/ G) g4 a& W5 Y
'*********************************************************** : g6 F& F- J6 t( U
Private Function MakeTable(byval tdata)
9 O4 j: n8 z2 `; o: t4 J   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
/ q8 u4 [: X* z! A   MakeTable = tdata ( Q5 d0 d5 |8 s8 j; }8 [
End Function </P><>'*********************************************************** $ u5 u/ f; h. {& G: X4 r: W
''@SDESCRIPTION: Draws the Debug-panel : }7 K2 k) ^# e8 K; V
'***********************************************************
4 b% d; z2 c" Y8 GPublic Sub draw()
$ x) ^5 n  m5 s& D8 |. t- z! z, e- o   If dbg_Enabled Then : ?' E- B: p5 u$ T% v
     dbg_FinishTime = Now() # V. L3 r* G" [2 }
  
) j( {9 X+ n, B6 W' Z   Dim DivSet, x
3 ?% B& ~) X  ]% }' k/ {   DivSet = split(dbg_Show_default,",")
3 S. l' {7 r. W7 e+ e     dbg_Show = split(dbg_Show,",") . N$ P$ T3 _0 F. x; k
  - W! f+ E0 P& Z" s+ a
   For x = 0 to ubound(dbg_Show) 2 h/ G! J% z% X- D
     divSet(x) = dbg_Show(x) ! }, U- u" T% e" \7 x2 _
   Next
: j2 m$ i. V& V+ H5 Z5 }- ?4 b  ( [2 {! \% Y; v  r5 g! h
   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;"
8 v" L0 P8 w, w/ R   Call PrintSummaryInfo(divSet(0)) # Q* K4 A  |' {) P: Q
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") : i' _0 y* K& _/ L3 A
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
4 s. x" _( A0 b; l    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
3 k- L4 g8 ?4 u% l8 T  B7 J    Call PrintCookiesInfo(divSet(4))
5 E9 |. N- o, t- V! K0 ?! z    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)) , V  b: M, `' {! S6 [
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
4 k' x& s4 f6 n9 H    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
) J: q& k1 Q3 P" d* n# k9 O8 q    Call PrintDatabaseInfo(divSet(8)) 3 T: B9 X* X  d" u& I8 a' P
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
" p$ P/ ]" n* R* `" f4 x) P1 k9 a    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# n( H; U& }2 }* |    Response.Write "&lt;/Table&gt;"
' r' F/ ?1 g" S   End If
  \2 ?1 o# @) `6 J& lEnd Sub </P><>'Destructor & P3 k, m7 d' Y
Private Sub Class_Terminate() ! @4 q* {" q5 q
   Set dbg_Data = Nothing
8 Z9 K# l  @4 [$ \+ J' b' p6 {End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
  q5 `: Q2 m& h* _CLASS debuggingConsole ' ~# [8 A( v: f5 F) ]& G
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
2 V, I9 b7 S2 u. l- ~& \2 q0 N&amp;n
% ~3 S2 t5 @3 l+ d0 r( Rbsp; : H+ K! P" N; E2 s! H! r, n$ K
Property Get Enabled===[bool] Gets the "enabled" value
; P- g' g# V% v& d5 u: p  + W" E4 H( q# y  s' v! M
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 * F2 [2 [# {9 c. J; V* O0 x' ^
  
3 H# N5 v1 s; y7 fProperty Get Show===[string] Gets the debugging panel. 8 P* i  N, m) B# Q2 s
  / X/ d! j$ v' s( `5 g
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><>-------------------------------------------------------------------------------- & V) A& W4 P) }; M
Public Methods </P><>public sub===Print (label, output)
( h" g7 h" [! e% g1 w2 ]0 |9 R- ^   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
+ _; N3 _" g) v' o   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ) ]4 g; K5 m3 H3 V
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 9 R: b( p8 Q' z6 _3 ~
Methods Detail
. U4 U3 i5 p9 F* l% r1 p8 B( v  
; t7 u' t. |) K) H, R' Spublic sub===Print (label, output)
0 d; C, T2 a! u, O2 B- n: D1 XParameters:  3 m$ K% R" b2 E& }+ F
   - label [string]: Description of the variable 4 k& Y5 E; ^% j& G
   - output [variable]: The variable itself , d" f* G- y/ G; s" L
  
( f" a" m7 _) wpublic sub===GrabDatabaseInfo (byval oSQLDB)
! x. ^4 {6 X: d& NParameters:  
# k$ E# z" l- }( P8 o# Y9 d   - oSQLDB [object]: connection-object</P>




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