QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6458|回复: 1
打印 上一主题 下一主题

ASP中令人震撼的Debug类(VBScript)

[复制链接]
字体大小: 正常 放大
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>& ^( Z3 ^0 v6 q9 W
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! & I9 d. M# O+ P4 Y8 p
使用方法很简单: 9 \! Q( k' \) Z/ x# e3 X" m) M& u, B
test.asp </P>1 n) M; F5 |$ s) T2 B4 m0 |; U
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
) q& g+ k( L. N9 p% ^- k&lt;%
, D) h& H  Z* U* [* joutput="XXXX" : x1 p, T$ j( {, N. E! c
Set debugstr = New debuggingConsole ( P- r  L2 D% G( M
debugstr.Enabled = true , s5 \: z: D3 {
   debugstr.Print "参数output的值", output ( c9 H! M/ w9 M, n. w
   '…… 1 x1 Q4 g% s8 T- N+ B
   debugstr.draw
% b- |5 a$ S+ r0 i, S4 _: W' gSet debugstr = Nothing
5 z* r7 e) B7 @$ e& ^( H4 `# _) y%&gt; </P>! [8 }( y! L  s6 T9 ~3 ^. b
<>=================================================== </P>
( _) ~9 d% f4 A+ M<>debuggingConsole.asp </P>
. I3 f$ F( t9 c3 I. k6 j" t. v: k<>&lt;% 6 Q5 w, e6 i. Y' w3 ]. I3 e
Class debuggingConsole </P>8 _/ ?! E2 P/ F+ v9 [) r( v
<>   private dbg_Enabled
( B  [7 H- h, A1 ~' N: \   private dbg_Show
1 n" H0 f3 l/ l8 M, G0 V3 A   private dbg_RequestTime
6 q) D& G' E8 Q3 Z8 y  H) ]9 t$ T- t   private dbg_FinishTime - k$ f9 }- V0 m7 N4 t
   private dbg_Data
6 k. Q* L' J* c: l' f   private dbg_DB_Data , J4 C0 M* B5 ^  _7 ~
   private dbg_AllVars
6 j; }$ v; S7 m; c: T   private dbg_Show_default % y0 y4 z, }2 i2 [, U
   private DivSets(2)
' [+ a* [# {1 T' h   
2 m! w& i  e  I3 ]( i, G3 M'Construktor =&gt; set the default values
3 `2 _0 F9 }8 q% s, IPrivate Sub Class_Initialize()
* u, S8 l  j7 q: a) B   dbg_RequestTime = Now()
+ k1 ]$ w& _8 R2 D! G& U# [   dbg_AllVars = false
% S# P$ ~' w- {( ]+ t   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>; _7 F5 W9 O$ K8 i( O, f3 [  N# C
<>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>" R7 L2 w& a- K( ^
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;" l5 B1 P# s  D2 v: u
&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>
4 m. K% D9 `# s<>   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>
9 o: P2 ]+ s0 d/ I  U<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
  [. l) k9 `! z+ g$ J. k) x4 _End Sub </P>
. ^/ {6 y- f! d9 H  l/ d; D0 K4 Q<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
, Y) E, U' S$ @9 j   dbg_Enabled = bNewValue
. N3 ?& Y' J4 x' N5 v; _/ rEnd Property </P>
( J8 l* L; {. r5 y<>ublic Property Get Enabled ''[bool] Gets the "enabled" value " e9 Y1 T( Z8 y, n2 R& ?# m
   Enabled = dbg_Enabled   `8 ^2 y2 B. `6 Q; k
End Property </P>% P# U/ l) x8 H8 z2 v2 Y" D
<>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
$ ^, x; W. F$ {, W* j+ n   dbg_Show = bNewValue
* n! d: s( t! Z- Y+ d) f% EEnd Property </P>* U) g1 t# {" c5 S4 s
<>ublic Property Get Show ''[string] Gets the debugging panel.
: u+ ?0 w; c: e   Show = dbg_Show
! R0 u# F7 W" W8 h" rEnd Property </P>' X0 S( y2 X  [& P% v+ {
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 0 c8 P6 ?5 ]$ L" d
   dbg_AllVars = bNewValue , h' F* e7 f' ?# N8 B+ Y" d
End Property </P>
" v" g4 ]6 e! ~- K# k3 W<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 0 B" `' _7 }* g6 b1 _/ d0 S' X
   AllVars = dbg_AllVars
3 _* n$ |; X4 F  bEnd Property </P>$ W1 c1 I6 L; f/ s
<>'***********************************************************
: W3 [) B3 Q' }& d( Q. @$ f''@SDESCRIPTION: Adds a variable to the debug-informations. 3 Z+ ~; x  |& U0 _2 j( x8 n
''@PARAM:  - label [string]: Description of the variable
, s9 D7 G( ~$ V. R$ o''@PARAM:  - output [variable]: The variable itself 7 g3 Q0 P; r# {+ Q/ {3 X: v- ~+ }
'*********************************************************** ' x6 v6 n+ c4 [* \0 ]+ O
Public Sub Print(label, output)
' L2 n- F$ @' p2 ^9 P; u   If dbg_Enabled Then
5 F# x0 I  t: X; Q& \' P     if err.number &gt; 0 then . m( L2 N, K  I5 B" @; `
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
" O) n! m& P6 v# ]  y# F       err.Clear
) c6 u, ~, c6 H4 F4 w     else 4 H6 X% @0 G9 u6 Y. p. ]4 r
       uniqueID = ValidLabel(label)
. f7 L; Q+ [0 M' `/ Y/ O       response.write uniqueID ' Z5 N4 U) h* b8 k8 g' _$ O% c! I8 N
       call dbg_Data.Add(uniqueID, output)
2 S$ d# A# c$ w2 I+ @& `* `     end if 1 m7 Q) I* h/ s2 m: E& h
   End If 6 ^4 j3 K1 X0 x) G7 K# h6 Y
End Sub
0 H( ]7 \4 T9 W# V8 E  8 _3 a; r* |9 e6 ^% Q$ W  k; x
'***********************************************************
9 _$ ?6 q7 q) m  r2 `'* ValidLabel
3 T8 B' T# S' ]'***********************************************************
: O- y7 N+ \7 {Private Function ValidLabel(byval label)
  y, O4 [0 p7 s5 ~6 m   dim i, lbl / g6 l  Z0 [2 A$ c: g) {: K
   i = 0 & @* V1 k; K, }
   lbl = label
6 [& o, L  T- S' i   do 8 T- }! d  t# t% J
   if not dbg_Data.Exists(lbl) then exit do . t& Z+ v  w! q: ~- z0 ?
   i = i + 1
3 o6 Q+ X  g, E   lbl = label &amp; "(" &amp; i &amp; ")"
; f, q3 {& J2 ^" v/ a   loop until i = i
3 f% }% o7 u* G& e: K7 e1 |  ( |. U' J& n  e, a9 y4 K7 N
   ValidLabel = lbl
8 d, T  n# U+ ^. F+ H: mEnd Function 9 j; s# P: E: |/ l+ A
  
- [0 `* P1 {6 ~- ~6 q0 W' v2 W'*********************************************************** % a; x+ z  a% w. I0 I+ ^9 n6 r
'* PrintCookiesInfo 9 ^$ M8 v- J& A$ l/ i1 P
'*********************************************************** 5 a% r5 K8 Y( A9 `1 I! I/ {
Private Sub PrintCookiesInfo(byval DivSetNo) " W1 w7 W- x+ V+ {3 l
   dim tbl, cookie, key, tmp
- S3 R- R/ x) u/ @   For Each cookie in Request.Cookies 1 ^- ?+ E# m, Y+ I1 R9 T* J( @' x
   If Not Request.Cookies(cookie).HasKeys Then
6 K. g2 i# `# b6 k     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
( m# H5 N. o, `6 E8 }7 `   Else
& g/ f3 S+ a3 W7 [) `     For Each key in Request.Cookies(cookie)
3 {. p& f. e/ o7 ^     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
5 S; ?8 V0 L, C% PCookies(cookie)(key))   - s* U; W2 s1 k" ^: g) k
   Next / R, y7 K, W$ Z% b- s  K
   End If - C# `4 Z1 B2 Q; g( B
   Next </P>( P9 H. c0 I' j
<>   tbl = MakeTable(tbl) ' t% w8 s8 d% i% F4 C! v) ~+ u
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
) R0 V# p. ]2 T) `9 g  y1 E   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
( m; C# o, k3 A   Response.Write replace(tmp,"|", vbcrlf) 0 S! U3 ^5 j  M; T- n
end sub 5 V$ C* c. C  T5 x
  * j( g0 C* H+ e) d% ~
'***********************************************************
9 b2 B8 d' N, q% Y) I- I'* PrintSummaryInfo
0 D- i9 J! F4 S# M% H# h'***********************************************************
$ h! m, C) X" b/ O- r! [9 @. NPrivate Sub PrintSummaryInfo(byval DivSetNo)
/ c" W5 W8 J% \8 u   dim tmp, tbl 8 s1 u6 a5 }+ n% W
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 9 O& ^8 S1 T  }- c
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
6 q5 Q3 {% v; U. D0 K' u   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
, I5 d2 c7 ]) V0 F6 j( \6 l   tbl = AddRow(tbl, "Status Code",Response.Status) " N9 z& Q! P4 l8 g
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
3 ^* L) z( F, H7 k   tbl = MakeTable(tbl)
7 S6 b9 ?/ _7 z4 [2 F6 F   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
/ A+ ~$ P8 p2 V! }   Response.Write replace(tmp,"|", vbcrlf) ! {4 z7 V% A, j2 S: Y, H# l$ ]
End Sub </P>
; \# y9 U1 \! n0 Q4 T$ A# h; p<>'***********************************************************
" Z9 v; x# b" u1 `''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information * m& d& V+ N. r, Q1 |/ M
''@PARAM:  - oSQLDB [object]: connection-object
' l5 N. l: l& v- C# Y5 Z3 N'***********************************************************
0 H5 ^+ A# b0 }% \" \Public Sub GrabDatabaseInfo(byval oSQLDB) " v$ Q" S( _, L- j0 u& H
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
0 \! L8 X1 c7 z; ^, r' h   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 2 E, c/ S3 Q4 k3 }$ C  O
   dbg_DB_Data = AddRow</P>
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持1 反对反对0 微信微信
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") &amp; " Ver: " &amp; oSQLDB.Properties("DBMS Version")) ' J8 Y2 h5 K3 z% m% T2 B
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
5 @1 X! A, P2 M3 z# j- n4 T6 ~End Sub <>'*********************************************************** 2 F/ ^0 g7 c8 V# d( \
'* PrintDatabaseInfo
5 W, E; T* S+ y$ a'*********************************************************** ( K$ Q; U" ^- ]2 W
Private Sub PrintDatabaseInfo(byval DivSetNo)
! x) e, B4 u  G( O* `   dim tbl
+ q7 e1 l- P, q+ f   tbl = MakeTable(dbg_DB_Data)
8 k7 T# P% m9 \- \   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ' z5 k. S) z" d: }2 L& Y% {7 p9 h
   Response.Write replace(tbl,"|", vbcrlf)
. N, v2 [' q+ k# CEnd Sub </P><>'*********************************************************** ) X! v* A8 a9 d; U! |
'* PrintCollection 4 [) a+ J" e, F
'*********************************************************** 4 M  d6 o" Y. p
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
  v; C0 }! G: M  B   Dim vItem, tbl, Temp - n. h9 _0 H/ Y2 i! P6 a' i6 Y
   For Each vItem In Collection
. K  W: u1 j6 S& [% R" b4 C; S     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
: U  p3 ~7 B* Z  [3 Y& q% K       tbl = AddRow(tbl, vItem, "{object}")
5 K' f# Q0 I$ C8 X' x     elseif isnull(Collection(vItem)) then ( C7 B, h* p* T8 [* i6 @) P/ _
       tbl = AddRow(tbl, vItem, "{null}") % F& D% p. r5 ^6 d% d' Q- g
     elseif isarray(Collection(vItem)) then . j: d% T# k' Y
       tbl = AddRow(tbl, vItem, "{array}")
1 g5 \- H; N0 q8 r. {7 e4 @  j     else
& [/ S8 j5 f: z% v       if dbg_AllVars then * P# [  c, M+ Z5 ?- Q
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 8 L" _4 H: d& r
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
1 ^4 c: ^; v0 H/ {       if Collection(vItem) &lt;&gt; "" then . t$ e) T7 h8 `5 |& S7 z) `! E
       tbl = AddRow(tbl, vItem, server.HTML
) Z5 }, C8 w8 L6 e- O, k: KEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") # c# ^& Z% p+ K, I
       else
# f2 H% W% J1 L       tbl = AddRow(tbl, vItem, "...")
9 \$ n+ x! |. m: M' N6 P# r       end if
' r! Z( ]1 k4 f2 |     end if
2 r/ I, z$ I! O" D" M   end if 0 h# p" q) H+ I" b% }
   Next ( X: W* c8 K. I' J8 p
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
/ D, w# q2 s5 `5 @; [1 _   tbl = MakeTable(tbl)
, R2 |9 r  g& ]+ p; z: ~2 g   if Collection.count &lt;= 0 then DivSetNo =2 3 V" ~  X+ u/ G/ g5 Y
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : l: p) f- P! l( O/ y5 z  D' O& |1 S) [
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) * g" X% n" A% i5 v
     Response.Write replace(tbl,"|", vbcrlf)
% _  M- x; l) f2 m- {End Sub . I1 l* c+ l( m+ _1 q
  0 e4 C5 i) W$ U" v4 M3 h! h
'***********************************************************
( r# x0 K( N' @  H8 H! u5 {: c" S'* AddRow 1 l+ _& m, ?2 v* |$ c2 o& G/ L2 C
'*********************************************************** 1 ?' Z+ |' g# h( Q3 C8 \% n
Private Function AddRow(byval t, byval var, byval val)
4 G9 t6 y1 X9 `+ z6 I; n  c   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ( y+ N2 \( B2 w- b
   AddRow = t
4 x6 V! C! E; b7 t. f4 kEnd Function </P><>'*********************************************************** / o7 n. C+ T5 H+ ]3 b7 f8 z6 t
'* MakeTable & R  b/ ?! Z" w) W
'*********************************************************** / k2 g0 v6 D- L- \! {1 G% ~/ p
Private Function MakeTable(byval tdata)
1 u$ K8 k1 `9 N9 @' b. }0 e   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
/ }! d( v. ~( g. F, Z& |   MakeTable = tdata
! p7 |8 x! q0 y2 @End Function </P><>'*********************************************************** ! d/ Y9 I. D0 L; q/ S
''@SDESCRIPTION: Draws the Debug-panel
6 R8 D4 P3 n  Y) I/ y9 D'*********************************************************** 4 X' K" K  ^8 `  Y. {+ \
Public Sub draw()
. y1 r1 E! M! F+ \9 K  H   If dbg_Enabled Then
5 T9 q4 F% Z! @3 i     dbg_FinishTime = Now() ) G# f5 _9 M# m; i- U4 j  Q. V
  
" Z7 A  S% J) ~+ W6 Q4 F* d   Dim DivSet, x ; u1 ~4 B7 q5 S  C. g
   DivSet = split(dbg_Show_default,",")
6 P* R, d0 P2 G) l3 Q1 S     dbg_Show = split(dbg_Show,",")
5 r5 l7 s  D  k+ m" c  6 ^$ d' \8 m; [- q  q% T2 p; O
   For x = 0 to ubound(dbg_Show)
# R# c3 v+ c' n& B0 M     divSet(x) = dbg_Show(x)
% ]/ N$ A9 a: t$ U* P   Next 0 y7 |5 L2 p2 {
  ; \; Q- k- I. O! u1 u1 t
   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 s8 M: T4 t) ]! L0 M   Call PrintSummaryInfo(divSet(0))
) \) S6 `1 M/ n& _$ i5 d     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
  ]: A/ s* p) V5 A    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
5 q$ k  d% R, F1 Z6 W* A+ z4 ^4 ?    Call PrintCollection("FORM", Request.Form(),divSet(3),"") - k4 U& ]2 c( w; }2 L3 y
    Call PrintCookiesInfo(divSet(4))
# B2 o7 X% z2 V, A/ E; q    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 n9 T) ]; P3 }2 d" {% A  s( c
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 5 m. C+ ^" l! B, \4 H/ P3 N- ]7 A
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % j8 b7 D3 \$ N
    Call PrintDatabaseInfo(divSet(8))
/ r4 h" \* J; c) H5 V    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 c# z. `2 K( N9 M3 R
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 l0 F; b* L1 |+ ]
    Response.Write "&lt;/Table&gt;"
2 \, g4 h2 J7 [- ?. B1 _   End If
; A# V6 x# F8 V$ B/ gEnd Sub </P><>'Destructor
: \. Y" X, J* w3 R  vPrivate Sub Class_Terminate() 2 @; T1 r, Y8 p% s( v8 d  @$ d
   Set dbg_Data = Nothing ' D$ ^' V& V% A9 `
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
* \$ s8 c, x' G2 Y& JCLASS debuggingConsole - q% ^" F3 e9 t# z
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
* m' ^; h& [/ Q8 e- [&amp;n2 |. `1 y9 S, [* c. ^& n
bsp; 1 L$ F, @. K/ e. D0 A2 s# ]) \
Property Get Enabled===[bool] Gets the "enabled" value & |0 K6 I4 e* p# B' P" Q
  
8 M5 ]; W$ g) I. s2 HProperty 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
2 M* B" X! g0 Y8 L6 }- X7 V  : ], o/ r. h* C
Property Get Show===[string] Gets the debugging panel.
% Z! X' T& c0 J6 i2 i  2 t- T8 L0 L; t/ |% u8 G  i' J, ]! u
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><>-------------------------------------------------------------------------------- / t1 }+ k; Q" s. C4 |/ Z6 ?
Public Methods </P><>public sub===Print (label, output) 6 ~2 m# O7 r9 t! c3 T% \$ n4 R- }
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 3 A! O- ^) y9 }5 k) [! `( e
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
' m2 P/ ^! ~; A( K/ l0 a( {   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 4 G( ?( a% U1 g8 ?: E9 C6 ]
Methods Detail 8 H1 C! H1 _& U  P
  
. m5 ?% x% P9 G+ z. K5 E. cpublic sub===Print (label, output)
4 g5 f6 b7 R6 B1 MParameters:  2 p. ~1 {% [; E" P5 v. {& S3 L
   - label [string]: Description of the variable + ^1 p$ x* i2 Z
   - output [variable]: The variable itself 6 o% D7 V7 u4 j- k1 {  T
  8 e1 Q" {8 `+ m# J( U: W
public sub===GrabDatabaseInfo (byval oSQLDB) 7 c- J/ ]3 ~' U+ Z! Q
Parameters:  
1 l% A7 @. G1 w. s7 f( \& r   - oSQLDB [object]: connection-object</P>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册地址

qq
收缩
  • 电话咨询

  • 04714969085
fastpost

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2025-12-7 11:43 , Processed in 0.497941 second(s), 56 queries .

回顶部