QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>' A  s, H! ~. y( L: `+ E
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 9 e# F+ F/ j! q% p* m
使用方法很简单:
# J: \5 e# x: W' u9 b2 Btest.asp </P>" \' h, W) i* d* N
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; : K, s, H; X  l8 ~8 {/ j
&lt;%
1 N/ C/ f2 g( {- ?2 T& ?output="XXXX"
5 O& |0 i) x" @$ ?Set debugstr = New debuggingConsole
- \6 z& N: o  D5 @3 f, Z% i; Odebugstr.Enabled = true
. I) M  g- l6 b2 |   debugstr.Print "参数output的值", output ' ]( R  G  L* o5 \
   '…… 4 `* i+ E0 n* C* A
   debugstr.draw
8 T# o! G. u* _( ~Set debugstr = Nothing
8 _# ~' i5 l! m, z! ~%&gt; </P>
" U/ z4 U% y! g% o( {0 G5 P  Z<>=================================================== </P>
: e9 P: ^! E$ E  D" b/ h& [# Z<>debuggingConsole.asp </P>
; F7 m* W/ m* d9 |  p" p; G/ \: o$ b/ [<>&lt;%
9 B. D" o9 X* c4 |. H( AClass debuggingConsole </P>
- d! Y3 k) x3 _& Q# Q3 w& R! Q; n2 q<>   private dbg_Enabled * E! V5 C( |$ a
   private dbg_Show
  d, Q6 {8 O7 V# r( H+ l   private dbg_RequestTime ) [- u! m# K3 S% k# T8 ~2 m
   private dbg_FinishTime " O3 j1 C. t/ h5 @( Z0 W% A
   private dbg_Data
+ _0 Q3 m7 N2 c  a- o0 N8 K   private dbg_DB_Data . \+ n2 K  ]) V. b" b4 n. {0 G
   private dbg_AllVars % @' X( r% Y5 T2 k3 I! U
   private dbg_Show_default
$ [# N5 V: O  y: D   private DivSets(2) & ~- g- a) |6 U$ E
   % b' [. x8 @" T2 ?
'Construktor =&gt; set the default values
+ a- d8 Q, _5 W' Y: r5 gPrivate Sub Class_Initialize() ' U2 m, n- O2 W$ t  ^6 n# b
   dbg_RequestTime = Now() / k& [6 N+ d# H
   dbg_AllVars = false 7 H2 R  d, r/ G5 [' z5 g& \
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>! b$ ^2 E  A. D/ ?3 U" s# ~
<>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>6 F) C2 a4 m3 D) ~% h  F0 m* O* ~
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
% s2 B, K3 Y8 L# d+ Y; u3 G3 f& F7 l&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>
+ j3 R% J: k( B7 O" O9 B2 J+ 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>, y8 h+ u- e3 y( f# q- }
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ( ~6 r1 A; I  T7 Z7 {: P5 l
End Sub </P>
- y. q# I2 [, R8 r1 u# j<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
; X  Q5 y" A7 R; ^7 Q  t   dbg_Enabled = bNewValue
( h' i' P  Y( O% R" CEnd Property </P>: s5 [: j* c$ S2 R( i
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value & B0 Q0 Q8 x/ I
   Enabled = dbg_Enabled ! h% Z3 Q, I) L+ _; T
End Property </P>
2 t, h8 U4 y: o+ t5 F6 \% k<>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
' H$ L: @2 G$ P   dbg_Show = bNewValue - k2 o2 {1 e5 K* F5 n- K$ y
End Property </P>+ L+ h* E) t# k: Q$ F8 U
<>ublic Property Get Show ''[string] Gets the debugging panel.
# @/ F% }& o" I' ~, e$ s   Show = dbg_Show & }3 P7 }) M( u8 L
End Property </P>
; z  P+ ~" Y! l# G( R% |$ D8 P<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
' r( t1 i6 I) `- ?% l   dbg_AllVars = bNewValue % R6 }7 ^- A! w( y
End Property </P>' Z2 [/ C: }6 V) ?
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. # B0 J; I5 f. a5 R: p3 s
   AllVars = dbg_AllVars 2 j  ~, M+ m/ i
End Property </P>
! H7 r+ v4 s! A, g' `1 G5 {<>'***********************************************************
( x0 U+ k$ }7 z  A* E1 O0 z% f0 u  W. J''@SDESCRIPTION: Adds a variable to the debug-informations.
- Q9 J$ Y' j1 `* l4 y: C''@PARAM:  - label [string]: Description of the variable
; T% `" e+ k3 V/ x$ M''@PARAM:  - output [variable]: The variable itself ) Z" q& L2 b" {
'*********************************************************** 1 m, |  g  X- I4 {# h* k' [3 r1 j
Public Sub Print(label, output)
/ ^' b0 J& A/ N/ {( o/ e   If dbg_Enabled Then 0 S: q  l- S+ }# [. C9 T( M
     if err.number &gt; 0 then ; q3 _: ^* K& G* u
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
  b( X5 U2 h* X( M       err.Clear 3 M7 ^4 L% p4 J' k* `; b2 u7 [
     else ' F. Z, O) N7 X$ T% ^
       uniqueID = ValidLabel(label)
7 n( X6 O, ?: Z8 G       response.write uniqueID : L+ J  a1 x: g2 `, ^  }
       call dbg_Data.Add(uniqueID, output)
7 e9 @; [8 r! D2 d- x, a     end if ( V% U0 t; n; a# l! _
   End If
3 t1 I) n7 W; {6 i0 z% H% u! Q  NEnd Sub 5 {# H6 o+ T0 S9 P9 D. f
  8 T  a0 ?! _! w4 O) `0 p9 k+ k$ A% h. w
'*********************************************************** ) n+ n5 \, ~( {, N" N
'* ValidLabel ( C" V' U( h5 E
'***********************************************************
# \8 j, @6 x9 E  ^. t0 B  y  u1 b% _Private Function ValidLabel(byval label) 8 h4 e/ s: B9 I( v! A8 j, z
   dim i, lbl ' `9 H7 L6 |7 P+ K# N1 N  {( v7 m8 N
   i = 0
: Z6 `0 d2 m% c. E   lbl = label
% M. u! d- y. q0 R# R   do
4 B7 q+ k6 t* Z6 G# Q7 |5 T, p   if not dbg_Data.Exists(lbl) then exit do ( |( @* T" `+ i
   i = i + 1 . |+ c2 ?* X3 m  h7 y. \- \8 ]
   lbl = label &amp; "(" &amp; i &amp; ")" 4 I' }+ i* L- d- X. e  h9 k3 a
   loop until i = i 9 R. V: Y: L# _0 |3 }3 C! p
  
# |, [$ [: g- \2 \+ v; z! K   ValidLabel = lbl # C3 a' H% s( Y5 g% R5 Z) `, J) q
End Function ; j8 B$ O1 @" b: T, K$ f8 g
    t) G/ a- L) f7 c0 s
'***********************************************************
; D7 a  ^0 ^! j9 F9 {/ E'* PrintCookiesInfo
+ d. {% A/ N% z8 ~4 X& I$ E'***********************************************************
* z1 I7 c% Q. x  b. ]6 o/ TPrivate Sub PrintCookiesInfo(byval DivSetNo)
1 n+ C# n, A- b  j, m" o8 h   dim tbl, cookie, key, tmp
! z$ h) E6 k5 L! b% s   For Each cookie in Request.Cookies 9 T. _1 J' j5 O7 s( Z
   If Not Request.Cookies(cookie).HasKeys Then : _# n9 D& X0 A+ U8 S6 b4 Y" B
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   * w# O8 R" J7 ^
   Else 1 L. q& x4 P- g2 z- ~
     For Each key in Request.Cookies(cookie) / [' N5 ~# V# ?( }+ Q# i
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ( K! l' y. M5 z: P! \0 o8 z
Cookies(cookie)(key))   ' D) u2 H7 M- ]8 U; B( w
   Next
: t6 i7 X8 G! c3 S5 O: C   End If 3 i+ T, m3 w4 `  L
   Next </P>
; e! A# B9 P6 T- g1 A<>   tbl = MakeTable(tbl)
$ R7 O- o. a7 W" F   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 : }2 R& W- K! r3 X4 {! e% C
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
/ ^- @1 }6 M1 V6 c5 x   Response.Write replace(tmp,"|", vbcrlf)
# D/ W& U0 i0 J/ O, N" B* N/ N3 _/ }' m/ }end sub
4 a! g3 C3 H" R+ g  " ?1 b% o& G6 ?
'*********************************************************** : x* |+ ^  w9 D% y1 x
'* PrintSummaryInfo
# U/ `4 B) [6 V+ m, M3 E9 q$ P'*********************************************************** / S+ m& c1 \& @' v! z9 J
Private Sub PrintSummaryInfo(byval DivSetNo)
' H) w6 |) M. t0 t5 z   dim tmp, tbl 8 U0 C4 |1 R9 _
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
* Q; W8 J! o$ [6 [0 }8 J/ N: w   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
8 m+ S  N! \7 o1 c- j- k+ S   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 3 D- Z5 P+ d8 r- u$ z; S
   tbl = AddRow(tbl, "Status Code",Response.Status) 2 o0 `1 i6 h" u' O- t
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
# R- x/ B9 n. ?   tbl = MakeTable(tbl) 5 R6 r' Z+ y9 j$ Q; I
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) . o- L4 N2 m, k6 H
   Response.Write replace(tmp,"|", vbcrlf) 1 t3 j, p9 W7 I2 b' p
End Sub </P>- \2 w' A- F$ S7 l
<>'***********************************************************
( v! R5 l- C* d) X$ P+ R) Z) t''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information * D. k: O% [, f4 Z
''@PARAM:  - oSQLDB [object]: connection-object
6 A1 w, L/ ?1 g. {3 Z+ @( L( d& N'*********************************************************** " m0 _/ O8 @2 |
Public Sub GrabDatabaseInfo(byval oSQLDB) : [: f! H% Z( q& j8 ?6 C* R
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 0 [7 Z) e/ `5 N/ |' _/ ^7 j
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 0 Z+ P4 R$ c6 s
   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"))
" @3 |9 J5 D- H# }( v   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
, X* h) Z. [8 `6 x6 q* aEnd Sub <>'***********************************************************
# `: U* P  B6 f1 K3 K'* PrintDatabaseInfo
) `9 D! `; n& w6 U' S/ D'*********************************************************** $ m5 O, v! |5 o
Private Sub PrintDatabaseInfo(byval DivSetNo)
: k; Q; s2 _( s   dim tbl
4 x& d9 `# }$ W: D2 Q   tbl = MakeTable(dbg_DB_Data) : |0 N! X+ f& O9 l
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" L2 p1 y9 j# [! `   Response.Write replace(tbl,"|", vbcrlf) * o* e6 f: R. i8 ]4 e* _
End Sub </P><>'*********************************************************** 1 c3 ^. a+ K# e0 A
'* PrintCollection
( @; M- q$ o* @4 D! [5 R'*********************************************************** : P" b! m0 P4 G& ?8 T
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# t9 I' C! Q# G* m   Dim vItem, tbl, Temp
, \# n2 `& R( g% l   For Each vItem In Collection 1 m& X) e0 p$ J  M3 d$ f
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 2 O7 G/ S8 t; l' V' X; X% O: L# ~# O
       tbl = AddRow(tbl, vItem, "{object}")
! b: `" X) R( _( ~, e     elseif isnull(Collection(vItem)) then
! F% J# a) |/ r8 T, J       tbl = AddRow(tbl, vItem, "{null}")
! e' G- x" D: `, m- A* l5 l) g     elseif isarray(Collection(vItem)) then
; W% H$ S3 N, [- i       tbl = AddRow(tbl, vItem, "{array}")
4 ^' E6 x+ |2 E7 N1 r, p) V8 I     else
/ @& l' V* R6 Z& Q       if dbg_AllVars then
/ t( B7 y" c7 J- F       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
9 _6 `" S( h* j+ s1 e$ D     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
' {7 T* q3 z4 O; ?& K5 N; W       if Collection(vItem) &lt;&gt; "" then
, i. h: l3 b1 q; F8 {       tbl = AddRow(tbl, vItem, server.HTML  s+ t/ C5 |2 d9 d8 v  u7 ]( z
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
2 v$ |& Z; I  \6 P; ~       else
5 J0 j" e3 `/ z- |, e       tbl = AddRow(tbl, vItem, "...") & u* A: N/ t# R, Z1 I( ?2 p
       end if + ?% @! A  w& n% V3 e
     end if
; `1 k7 H/ \% j# j9 O( S   end if ! H2 F+ M" q/ ^
   Next ! b2 }  J/ o9 T& C
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
, L' ]6 J" E$ t1 N   tbl = MakeTable(tbl)
) H4 Z3 L. [% S; R1 p1 O: k   if Collection.count &lt;= 0 then DivSetNo =2
3 K; x& o# a8 b     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ' x$ i5 p; u$ A5 |
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
6 B. ]) T4 T$ ^2 ]8 v; b2 f     Response.Write replace(tbl,"|", vbcrlf)
9 w% E' X4 K* }& uEnd Sub   u! R- ~5 k6 x- K
  3 L5 F: [# u+ A2 d
'*********************************************************** 2 w, x' u# i( B5 x( l) ?' {
'* AddRow
8 j4 B; k' f$ q5 N% b4 E8 p'*********************************************************** & f4 O7 r  Y2 n: r
Private Function AddRow(byval t, byval var, byval val)
- M/ ]0 r( A7 y6 G/ ?% m0 ^   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
( o# P, {4 x0 n! Q+ M3 Q4 C   AddRow = t
: Y1 m8 C  w/ [* u7 k9 kEnd Function </P><>'***********************************************************
' s, ~3 o: F9 y! _3 k" R'* MakeTable . l5 M( U% m' Q! b7 H& c
'*********************************************************** + v0 ?6 a! }' E1 n/ D' i  l
Private Function MakeTable(byval tdata)
  A) s; g1 o! a) c   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" - l" M* S- U7 i
   MakeTable = tdata 9 K! V: m3 }% z6 y: Q  Y
End Function </P><>'*********************************************************** # e0 e; Z  ~5 D: d' I& I; c( Y
''@SDESCRIPTION: Draws the Debug-panel
8 H" j/ e  z; r/ I- o, Y'*********************************************************** ) ~* l2 q! e/ x% Q7 P
Public Sub draw()
" i6 U$ _% v3 R$ V: g   If dbg_Enabled Then
2 h9 r  s9 V1 T& k" ]/ M9 ]     dbg_FinishTime = Now()
% P& q% o3 G# [8 P  
& H  p% Z* U$ t9 t! [- k   Dim DivSet, x ' n7 r- P9 a$ ]0 s% n- N! L
   DivSet = split(dbg_Show_default,",")
3 W5 L$ N& y4 C, @) _  @* y1 u" v     dbg_Show = split(dbg_Show,",")   q1 U0 P' X' b3 s. r$ H
  5 ^6 h" w- a2 e1 l
   For x = 0 to ubound(dbg_Show)
- D  A+ m2 B' y  K2 T4 |: y% T' C' u1 u     divSet(x) = dbg_Show(x)
% l& ]) W8 B0 k2 E3 i2 l$ q5 u   Next
8 Z7 R: \/ ~. K' i  Y3 x$ n  
/ O" g  X5 S2 j3 j   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;"
. F; p- n7 X! L1 a7 _9 q   Call PrintSummaryInfo(divSet(0)) 2 K4 Z) {& {% C
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 j2 I9 p$ H6 X+ {) }. s$ r* s
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, h' ]( |. [1 J( N. X( m    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
( h: z- I* j% g! I# f0 [    Call PrintCookiesInfo(divSet(4))
) L8 W$ ~+ U9 _$ f. U7 j    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))
5 E# T7 r2 @7 e8 S1 o8 W    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ( C% R+ Z' q: R$ v0 `* |  n
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
; W7 D0 \9 m: W% i    Call PrintDatabaseInfo(divSet(8))
" k. S5 p+ o/ i  G' s    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " Z4 r: g/ m5 [$ O: M6 q, w
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
3 Z: N! |+ g1 ]0 ~2 S6 k9 Q    Response.Write "&lt;/Table&gt;"
% i9 j( ^9 ~( h2 @  n   End If
) c! g; V- B# _- ?  vEnd Sub </P><>'Destructor
* b" x/ a7 V' X" D9 t  XPrivate Sub Class_Terminate()
& _# c$ O  J  A( D' J   Set dbg_Data = Nothing   h1 L5 Z, R% o" |; ~* t2 o
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
' s9 b9 c- {0 xCLASS debuggingConsole
1 a  o, {. e$ @; M; g" Z/ S2 L7 gVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " a6 k# a% d6 Y6 X9 G+ h+ l
&amp;n
0 O- G9 R+ G2 {% d6 |9 X4 h6 g% e$ Kbsp;
5 D$ L" H% T8 `. F* J; BProperty Get Enabled===[bool] Gets the "enabled" value & A; t. `6 [2 |8 X: r- Z1 N
  
# V7 M7 \3 k# D' |# fProperty 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
/ L3 ?% O7 G7 h. H8 z3 X  
4 Q2 }1 Q5 x! `. ~# q; E$ V! bProperty Get Show===[string] Gets the debugging panel.
. D  Q! W) `9 b1 O  ; [* Y& A& I' n! w: 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><>--------------------------------------------------------------------------------
- O5 Z: y& X3 _+ B/ T1 B& N5 {+ @Public Methods </P><>public sub===Print (label, output)
  C7 l4 C+ _3 d! X   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ( B) h6 @+ j+ t# c1 M/ b# U0 z% p/ v
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ( `2 F! x' X( M8 D3 g  T
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
6 k/ g$ N  m3 [" O# s5 N# m; Y. hMethods Detail
( ?2 v3 l4 B8 z2 q3 I5 o. j  
0 G! e1 s5 Z* N, s: B5 tpublic sub===Print (label, output)
2 P, L5 ]; l! e: Q* FParameters:  $ \0 C: Q- i  m1 C$ ^8 X* C
   - label [string]: Description of the variable
4 e9 S2 f( ~$ \  X   - output [variable]: The variable itself
" q" Q; ]1 p0 Y; l1 u6 m  
7 B7 d8 A/ `* f! u; {1 jpublic sub===GrabDatabaseInfo (byval oSQLDB) , B2 L1 u0 A* p/ j, B8 M
Parameters:  2 U2 {& B& {( }& g9 k
   - 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-7-18 12:32 , Processed in 1.106781 second(s), 57 queries .

回顶部