QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
- O- |! B- }8 w<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ! a. R3 w6 W. e9 p: B- j+ N0 x
使用方法很简单: % a1 x( j. ]8 `! J3 }
test.asp </P>
( r: B9 T, @) e* ]1 ~  x<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
' k6 E- g+ N9 I) n" [&lt;%
3 u; m+ L9 {3 q" \+ Qoutput="XXXX" - f& J0 G/ d# X
Set debugstr = New debuggingConsole
1 ]+ W2 H! H, o9 n" mdebugstr.Enabled = true
- K) n7 W# }& k5 G: p' C   debugstr.Print "参数output的值", output
6 H+ [4 G) h  T. S, z: O: H# ?   '…… 3 f6 i, [# N4 t% [
   debugstr.draw
" t- ^" T% K) O) F6 o' iSet debugstr = Nothing
0 P6 ^3 e% s$ e% N3 R% `, E%&gt; </P>2 K6 q1 H5 @& {6 _& \" z
<>=================================================== </P>
' s0 h9 S3 |0 ~5 D) y, x<>debuggingConsole.asp </P>+ b8 {& j/ ~& {% E0 h" A
<>&lt;% $ E  [6 a3 X8 e" l. o- U3 D/ H
Class debuggingConsole </P>
5 E6 \4 D5 R- L8 F# X+ `" h6 R<>   private dbg_Enabled
* g. o; h) K& {   private dbg_Show * D1 V. [8 M5 {9 @9 E+ {. g+ c: ?
   private dbg_RequestTime
' P$ W; i, B' }% V) i   private dbg_FinishTime
4 p$ B3 }- [% G+ Q9 i   private dbg_Data
; I, a3 |; _& }: ^# E, x   private dbg_DB_Data # W8 J5 J, e. ?  F; S7 ?
   private dbg_AllVars
8 A' Y; u" |/ K   private dbg_Show_default
) b9 T3 O5 H6 W/ n0 k   private DivSets(2)
! L* B* z6 o) K; }5 i- {3 f8 V   
( z7 |3 V6 O- Y0 ^: ?% ^  W3 C'Construktor =&gt; set the default values 2 k+ R& b! U* S4 v6 k5 m
Private Sub Class_Initialize() 3 V: z% K! e% {
   dbg_RequestTime = Now()
1 r$ M- v9 Q; m: F8 p. s6 r0 W; _   dbg_AllVars = false ' L( V% w( k8 }( H
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
3 _7 f* ^7 K- Q9 y! x  a+ M1 H<>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>
! _3 F' k0 o- Z. m. ^* }<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;+ x; ]$ F  z5 c3 T" E9 g* ^
&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>
( o! }6 F( e0 g& ], k7 q) f- e<>   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 l$ L3 u  b) X- n+ B0 B, m7 }" F2 H
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
/ p  O$ |1 l2 a/ m+ @3 z  ]End Sub </P>
; B( V( I$ ~3 C: [5 r5 o: _<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 7 I8 h3 i5 X& a* x  f! K
   dbg_Enabled = bNewValue 3 @+ `6 l7 E, {  H/ l
End Property </P>, P: b/ T+ D- f+ E, z
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 2 R/ Q4 K: N1 y8 @# G
   Enabled = dbg_Enabled 2 l% X7 C% H9 z4 L* o
End Property </P>( I/ |8 {9 A! o! I  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 8 p. Q/ l, b/ L' m  q3 T7 |
   dbg_Show = bNewValue 5 R7 e) k6 J9 b2 {
End Property </P>
: z4 U' O& E3 |/ i2 k<>ublic Property Get Show ''[string] Gets the debugging panel. 5 L& H& X; B9 p0 p- L2 a
   Show = dbg_Show
- s  m1 q  i6 Q/ W- v5 f8 PEnd Property </P>
4 A+ t; h( T9 a/ a<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
. e+ s0 k& m  \- \7 o   dbg_AllVars = bNewValue
7 y  b6 v7 l9 p# m4 KEnd Property </P>, K& \2 a/ B9 i$ y, m: H8 @+ H
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 8 D  n  [3 [& @  R6 }& a3 [
   AllVars = dbg_AllVars
1 @, P1 J. A( o8 l. h- x9 }7 n6 aEnd Property </P>
9 A7 C! T  B& `2 q: L9 ~: U5 v<>'*********************************************************** + j8 l. A/ ~9 `; @9 l4 |
''@SDESCRIPTION: Adds a variable to the debug-informations.
" w& C7 ?7 @1 {''@PARAM:  - label [string]: Description of the variable
1 M- U7 J2 P5 A7 b6 k7 @/ l9 K''@PARAM:  - output [variable]: The variable itself
. t- s: i' s/ X+ M& {: E# {' Y'***********************************************************
2 [4 V0 O% r( U. D; `Public Sub Print(label, output)
6 o/ K" Q/ f# J' b" z. O# {  K   If dbg_Enabled Then ' l8 ?, U" ?, w: M3 m; F: @
     if err.number &gt; 0 then * ]/ d& W) q5 i6 c! M
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) - f% j+ E9 d' d3 s/ |
       err.Clear
' v! o3 c$ x  G) x     else
1 \+ X; ]* ?! V# G% Y" o5 c' Z       uniqueID = ValidLabel(label) : ^+ h& E( j; `  J4 V& P$ L
       response.write uniqueID
, A$ \- [/ ]( g6 J       call dbg_Data.Add(uniqueID, output) 7 C' x% I* ~. f7 {3 d0 }0 v
     end if
* _. P" E- i4 V* w( e' Z   End If
9 Q$ \5 M) g% G2 p* u4 HEnd Sub " S" {. S' e( g5 i* [# n9 C8 S) D
  
/ j6 S' S( [# H'***********************************************************
5 p+ z) r% K; ?4 r1 i'* ValidLabel
( u" \9 V# P5 Y$ B& K/ S'***********************************************************
- \( ?; n' V1 R8 T& I( z6 Q: D  |  GPrivate Function ValidLabel(byval label)
( E; `5 d& a, c5 ?   dim i, lbl
! E% k0 q& M) h1 E4 _5 j5 P   i = 0 : j0 B& |. q7 a2 s5 l6 w$ ]: T
   lbl = label 4 _& G  e0 Q# N
   do 5 r1 j: P, Q, A4 ^) G  v% D8 E
   if not dbg_Data.Exists(lbl) then exit do
$ ^% z7 r( J  w8 j8 o   i = i + 1
! g8 t" h' ~! j, r' J   lbl = label &amp; "(" &amp; i &amp; ")"
! e% c( X, L5 H5 Y- i( _9 ?' e   loop until i = i
  D: q3 w7 ]+ \' R# M8 t7 h; R  
  Q1 ^& i6 T. G2 R1 Z. y( d   ValidLabel = lbl
2 a' m5 ~' ]9 e; W+ ?& EEnd Function 9 e4 V$ E" D( c$ p; k/ h
  1 O: _. C. Q; G( z! w
'***********************************************************
' R# w5 ]9 V: j) u'* PrintCookiesInfo ; w7 S' a5 h. ]( f6 N3 D
'***********************************************************
5 |, _: \' Z" @% M+ BPrivate Sub PrintCookiesInfo(byval DivSetNo)
1 E5 t- a6 h. u: q. N/ E$ k   dim tbl, cookie, key, tmp 1 T3 a# F2 \7 Q  s5 U& ?: x7 x0 \
   For Each cookie in Request.Cookies . e6 }4 O$ T6 ]$ d$ X1 ?* J' G
   If Not Request.Cookies(cookie).HasKeys Then 3 B& S) d7 T& Q4 u
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   6 s) _  J6 m+ E5 T5 w- Y/ m
   Else
% X( @9 _/ I; z8 [" b! u     For Each key in Request.Cookies(cookie) ) A- h% _- ~. R
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. . T" a& M, t% A1 u1 ~3 t, Q
Cookies(cookie)(key))   * g( Y8 Z* U4 B9 t# H8 y1 Y
   Next
- [1 `: E3 m; p( U& o   End If 7 N! u# l' W; Z# V% E
   Next </P>
! ]7 }& h9 Y$ b1 r<>   tbl = MakeTable(tbl)
3 Y& `& G# v; Y1 T   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
. [0 h- l4 v" G9 L) D9 U/ r   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
& {- }0 f( t: F( [; Q+ a$ e3 b   Response.Write replace(tmp,"|", vbcrlf)
" y& O0 p! j- Rend sub 2 M# R( |  j8 q$ J
  
  R* G  F0 V2 o! N$ H'***********************************************************
1 D7 G1 o7 U/ Y. X# u'* PrintSummaryInfo 2 a; k* ?& |- L; N
'*********************************************************** ( G& n* I/ U+ O) |
Private Sub PrintSummaryInfo(byval DivSetNo)
9 k) l2 A, S6 |' \' ?' }   dim tmp, tbl $ {( h, W: f. |
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 4 D% o$ j5 q  `
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") / d3 }$ d0 O5 _1 q
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) : q) u+ A0 b6 ]
   tbl = AddRow(tbl, "Status Code",Response.Status)
3 J( z, q' h+ k& N2 g   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 5 X! i6 z0 u- P
   tbl = MakeTable(tbl)
" @3 e5 I) i) G   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
- {& y6 [9 o# r( d1 P8 p9 Y0 x   Response.Write replace(tmp,"|", vbcrlf) 8 [- L% |6 k9 N; {) ~7 H  J* c; B
End Sub </P>6 P- H+ S7 X; w5 }7 w1 z
<>'***********************************************************
6 }) c- k. k. C9 b+ \& e6 ~3 K''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
5 j. S6 [3 t) z0 i''@PARAM:  - oSQLDB [object]: connection-object 9 W6 v) l; O+ z8 a! N- T
'***********************************************************
" I: E5 q0 b! CPublic Sub GrabDatabaseInfo(byval oSQLDB)
# `4 J* g1 }- K  Y+ q   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 4 s9 g7 i+ t6 T2 n) w+ n6 P' ^
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ' q- `; W% V3 Z! w
   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")) $ u8 Q' s8 o7 w4 ]9 {
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 1 {: A+ w0 {- x6 Z7 n+ i
End Sub <>'*********************************************************** ) a3 _! Z' n1 w" k/ k4 w; ^
'* PrintDatabaseInfo
' k6 S" ^/ z/ i3 s3 E'***********************************************************
# ]( j" |5 l  k6 u% o: x5 r) uPrivate Sub PrintDatabaseInfo(byval DivSetNo)
7 h) r6 w- |, M6 V! K) u6 i   dim tbl 7 n1 k  U: w4 W; V$ x2 ~
   tbl = MakeTable(dbg_DB_Data)
9 R. N  R1 H% P# H% r; U$ d   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 R+ s2 d& ~* |* Q
   Response.Write replace(tbl,"|", vbcrlf)
, `( ?+ J  m% X4 v7 EEnd Sub </P><>'***********************************************************
! H+ f8 ?% D! _1 @'* PrintCollection & `/ x4 T! |& z9 S- H* O
'***********************************************************
' v- J( f# V6 k' z7 p( {+ bPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) . T9 ?* \/ n" t% m: i9 d- _7 \
   Dim vItem, tbl, Temp , E% B' {: N7 g# p
   For Each vItem In Collection # e8 G9 F9 m" Q) p4 Z" {3 k
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
( X2 o0 g: A4 B9 c7 R) Q. ~       tbl = AddRow(tbl, vItem, "{object}")
2 q; u4 _6 w5 I     elseif isnull(Collection(vItem)) then , e; D" k4 q; c. y0 g& `
       tbl = AddRow(tbl, vItem, "{null}")
& q4 g6 f/ d2 n     elseif isarray(Collection(vItem)) then
3 w" o% v3 A* F) J: `6 U; x5 ?       tbl = AddRow(tbl, vItem, "{array}") ( _/ S+ V( p- P* r1 c
     else
9 @6 ?' @+ S( v0 L       if dbg_AllVars then - {, \9 @* S) q% l8 a; U
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ; G3 F  ~, k# e% r& c
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 7 ?; A* B, x  O
       if Collection(vItem) &lt;&gt; "" then ; Q* K# \" |8 `' ~, m
       tbl = AddRow(tbl, vItem, server.HTML8 f0 A$ L' b3 b: D5 C3 r
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
6 P$ a. \' f2 \- i" q+ V       else 9 E: e' k. I- S' _
       tbl = AddRow(tbl, vItem, "...") ( Z7 c' n9 ~$ Y$ m, L: M3 B
       end if
$ }/ w" x; |" c  w     end if $ }; m/ |4 Y  r! F( n4 L& ?
   end if ! t( ?( g+ ~6 h. G* }* w+ D  ~( Y
   Next
5 ^2 B; p" B" o. V. J, R; i   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo & k+ a. X+ W; M' G2 ^6 `
   tbl = MakeTable(tbl) " g2 S2 @7 q6 s+ y
   if Collection.count &lt;= 0 then DivSetNo =2 + P; v; U0 d( |4 V
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
, g6 c/ Y; T! J% u% D1 P# o     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 1 z! O' n/ e9 j, V0 h7 {# @
     Response.Write replace(tbl,"|", vbcrlf)
4 e  _1 F& M) \1 d2 H; bEnd Sub - h' F8 t3 [! \# Y5 ?& z0 T. A" M
  
$ G4 S; O; m0 @/ B1 j'*********************************************************** 2 X1 v% M4 ~' ]9 x1 W0 F' N
'* AddRow % z  \+ h0 c+ `- ^7 C! E$ H
'***********************************************************
) P$ Y; D8 b; _  u0 v- G' T3 ]3 b+ d4 [Private Function AddRow(byval t, byval var, byval val) - y, H- }$ H2 q8 p6 b3 M
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
, m& l( V+ R3 W5 [* A4 W3 M   AddRow = t 1 u' Z- i' G0 Z# A: c
End Function </P><>'***********************************************************
( E9 [- R# ]: v2 O, k'* MakeTable
: v* R1 ^4 g+ ^! {3 E- q'***********************************************************
4 T6 S; o" E) MPrivate Function MakeTable(byval tdata)
# x+ c* i, R* H9 Q  N   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 3 _/ L& _# G0 Y- M& F8 w
   MakeTable = tdata , c& p2 z) S( F
End Function </P><>'*********************************************************** 7 D1 G3 B8 H+ d5 ~' {! b  E
''@SDESCRIPTION: Draws the Debug-panel
% F" G' D$ ^. t  Q0 T4 Y$ ~: R'***********************************************************
4 s1 }1 ?! j5 a" d$ |Public Sub draw()
# e1 d% d4 x# K' H1 v" ?   If dbg_Enabled Then ! k4 V! y; M0 U: a7 ]& D7 \" n
     dbg_FinishTime = Now() 0 P* Z9 X8 E* d+ u7 t9 D
  
3 X% H) c) b; A& u/ o: P# A  w   Dim DivSet, x
& Y0 D; Y* q% P0 ~9 J% T# T$ O   DivSet = split(dbg_Show_default,",")
/ z. `" F9 t9 Z; `7 k     dbg_Show = split(dbg_Show,",")   h8 S* E6 \5 D
  
( T2 N" k0 ?% Y2 J% y9 ^' \, Y& o   For x = 0 to ubound(dbg_Show) 0 B; ^% R/ C( i8 K
     divSet(x) = dbg_Show(x)
, @; n( [( m) W, R" _   Next
1 U) ~  Z5 w. L6 U! m  e  , Q, F' A# F  s% w" R
   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;"
9 @+ Q+ C5 {! s   Call PrintSummaryInfo(divSet(0))
/ a! Z* ^; |0 ^) t     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 8 Z$ u" _% K- r9 T& b# a
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
7 i$ {3 ]( U4 R) E" h    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 A# _) x. q" y( p    Call PrintCookiesInfo(divSet(4))
4 }4 |. @& }# k5 w: G: b5 n    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))
7 q7 V$ c, }* m; z) k7 n5 ^( h& ?    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
+ X: w+ V% k! ~# q) e3 |4 n    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' i% \+ Y. J( [8 h% U& w8 p    Call PrintDatabaseInfo(divSet(8))
) f: F& T" s1 A% E  A+ A* J    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " l( z3 @* M( ^  W# Z/ u
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / X5 T$ o; g6 A5 f
    Response.Write "&lt;/Table&gt;"
2 x1 k1 c0 U  K! z  j   End If ' x6 }" C# F+ d. |
End Sub </P><>'Destructor 3 R( @# a9 L  g4 y2 h
Private Sub Class_Terminate()
8 C# F4 W1 D8 `6 j7 b( N% C& e/ Q1 c   Set dbg_Data = Nothing
, x, t5 ]: N: ]/ t& LEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>. m3 J0 a. `0 a& H- {9 L
CLASS debuggingConsole ; n" n. P( n& {" ]. ?0 X' T
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) e+ K. F' E* b5 B; L
&amp;n1 E3 `8 J, B5 {0 [
bsp;
! q4 L9 E- z: x* f8 t: gProperty Get Enabled===[bool] Gets the "enabled" value : ^( |# q7 U" y- w5 D% t0 N
  9 E% a4 V$ @9 O  L4 A$ Z
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
% {$ s/ G& J) ~  S* d8 ~+ T  
* X- d" h  ^* U9 HProperty Get Show===[string] Gets the debugging panel. / ]. b4 f, U: _, p' k
  0 H8 ?( k) R5 v& b+ N
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><>--------------------------------------------------------------------------------
" s+ V; V. Z. _# I8 }0 Y, zPublic Methods </P><>public sub===Print (label, output)
1 }! S3 R  O$ \% S1 b, H: n/ j& ~: L   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
! `5 S5 h; d# f3 G  T: b   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () $ A/ i8 ^! P  ]+ f3 c% e# t
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
$ K4 k* x" M" o/ aMethods Detail 9 y$ S& _# R$ e  M! \/ [# h
  ! y' ^, z" Q9 l  j+ J+ e0 A+ X; L2 h
public sub===Print (label, output)   F' h, Z; \  f. N) j- A( w& ?5 S5 Z
Parameters:  9 q4 X8 |/ s/ a" j" J
   - label [string]: Description of the variable
. L/ G1 j; a- l7 L& N& @+ q$ y   - output [variable]: The variable itself
, C' ]4 _0 |2 A) a/ |! v  
9 m  L* G: i/ ppublic sub===GrabDatabaseInfo (byval oSQLDB)
' E3 B4 X" k9 a4 ~Parameters:  
; w  e% {: ]2 S; A   - 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, 2026-5-31 01:39 , Processed in 0.499359 second(s), 57 queries .

回顶部