QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>; g0 e+ t% ]6 I0 {7 j
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
5 [: j% b( A  ~8 x; K1 \使用方法很简单: 4 t; a8 U( o  o  l
test.asp </P>: T8 n3 i" t, I! k
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
. h; k) Z- R% r1 ^* \&lt;%
( F3 ]. I, G" loutput="XXXX"
$ E! T; m, z6 N6 N& q' k, f# A$ RSet debugstr = New debuggingConsole
# G* K8 i0 a& C4 W" zdebugstr.Enabled = true 4 Q4 {; H' y$ N& L* N4 N
   debugstr.Print "参数output的值", output
! A' I! d$ s, f% U7 ?   '……
( o$ L3 k0 y* j% B) e$ M( ^   debugstr.draw
( s( C* p. `/ i! J# g0 R8 FSet debugstr = Nothing 1 ?9 Z: y7 P: ?* t5 C3 b! y' R
%&gt; </P>$ f" K4 B5 Z( L4 b; h
<>=================================================== </P>: T( g$ p4 |% H% A) V& l; t# k) C
<>debuggingConsole.asp </P>
6 k( w  n" t0 @* c( m<>&lt;% ; s8 z+ b0 p+ C" \! x6 X( B
Class debuggingConsole </P>
8 J4 l1 z) m+ R5 N) k3 Z- F/ u+ @  x<>   private dbg_Enabled
$ u) ?. y7 C7 C) u# u0 S5 ^   private dbg_Show * C. Z& T2 ^; F) B, y! h
   private dbg_RequestTime
3 x  j3 I' \# j' A3 n   private dbg_FinishTime
8 W% f% X0 U* G* L: l6 d! _, d5 Q* H   private dbg_Data + K; c3 ^/ K5 O. {5 }
   private dbg_DB_Data
$ ?( y: s1 P- l4 K" q7 }   private dbg_AllVars ' d: Y; ?) _" p& y& I
   private dbg_Show_default ! _/ z  K/ b2 j5 }5 S
   private DivSets(2)
$ }  R' \$ f' H5 ~) B   
! q5 G. M9 \$ \: z8 N% }% c6 z  i'Construktor =&gt; set the default values / y5 @9 W% Y; t1 Q
Private Sub Class_Initialize()
! ~7 X3 A2 @' g4 B! z" f2 }- Z   dbg_RequestTime = Now() % C. P% j* ^. @( X7 F
   dbg_AllVars = false $ Q8 I: i, n, m6 d, `
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>4 j: [7 _6 X6 e- z
<>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>5 C6 P9 D/ [8 O5 I% C
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
* X. M$ S- H1 R& ?, [&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>
9 B  k) f" b; ^$ z2 x* ~9 y. o; |<>   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>, U$ ~& L$ o2 A. @" {+ @$ `4 D: ?
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
/ L" d7 o/ [* r' WEnd Sub </P>" V" T( K; c3 H+ t1 H
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
: i( e( H+ r% S( Y  i/ }9 Q   dbg_Enabled = bNewValue * ?& f. d* b" [0 H/ ~3 W
End Property </P>3 U3 ]# [; ]( d  u
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
; |! U, c: I* g- Z   Enabled = dbg_Enabled
+ m. ]3 l% M; P6 BEnd Property </P>
7 D; k/ a0 g( E2 x7 E<>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 4 a) `6 ]% F0 g- H  g
   dbg_Show = bNewValue 1 [2 a, Y8 r2 h
End Property </P>2 Z' d+ [1 r  t0 ^4 [4 W
<>ublic Property Get Show ''[string] Gets the debugging panel. 9 m3 M; h% m1 ~+ h4 W0 b) }
   Show = dbg_Show
6 c! t. D4 h, l4 W# k1 ZEnd Property </P>
: J" I. B+ n7 W. D! u9 |) o6 h<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
8 J! N3 P* s+ u+ p( H, s/ Z   dbg_AllVars = bNewValue
+ M! R* h1 L& j) Z( wEnd Property </P>" x* ^$ n( c1 G: @! |( o. J
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. $ u4 F' r2 g$ E( `
   AllVars = dbg_AllVars
+ i; G3 I- v, I1 w0 pEnd Property </P>
* B  W+ o* V3 G* W6 {6 B<>'***********************************************************
& R; L, C' z5 D* \* w- M''@SDESCRIPTION: Adds a variable to the debug-informations. ) k/ }; A+ J, s( I  P" _' X, r
''@PARAM:  - label [string]: Description of the variable
+ V8 j  Y8 k; f" V1 v9 K% \1 \''@PARAM:  - output [variable]: The variable itself
7 i) X9 @" e! q- b- `'***********************************************************
( r9 B! l1 ~7 D/ g% `Public Sub Print(label, output) ' b/ u) A, C8 b& ?. K' \" y
   If dbg_Enabled Then / H# n" P3 L2 D" [- U
     if err.number &gt; 0 then 2 [$ |8 }  x* y4 }& D
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
% ]' I, z0 f$ E       err.Clear
& Y3 N, {8 f+ R2 P% M! d, s- z     else ( @& D9 \1 X' g  A' |5 x& |
       uniqueID = ValidLabel(label)
7 `: ?% ?: f8 |       response.write uniqueID
9 h1 p$ W0 Q8 X, J8 J       call dbg_Data.Add(uniqueID, output) 0 q1 R5 x' q% s1 t. t8 b% }, B+ t8 y" p
     end if
  W2 X4 V( r! d% u' R' F* i. p   End If
! ^2 ~- k+ ?! \End Sub
  n/ Q& Y3 h# k1 O  {+ M  - h* ^& R8 Y8 [9 {( I
'***********************************************************
; x! Y, ^8 B2 U'* ValidLabel
: \9 J( c) P5 Z! a/ p  h" N'***********************************************************
0 ~" l- Y  ]6 k" W% e2 OPrivate Function ValidLabel(byval label) ( o; h5 ]/ G* s4 H
   dim i, lbl
) [9 s: T- v0 W/ T% Y8 Z& Z: L: I   i = 0
% f. |( O8 |& [$ N+ X9 `8 ?/ c   lbl = label
& G2 n  ?$ Z) b2 d# o/ B5 a; |   do , ~# l$ x4 s) D
   if not dbg_Data.Exists(lbl) then exit do - f% h, e3 F4 a1 }# q0 R  U6 b
   i = i + 1
) }. [  C# d& H2 W) r. U$ w   lbl = label &amp; "(" &amp; i &amp; ")"
7 e8 x) F6 R( ~. l7 K" H& |- h; X   loop until i = i 2 f) K' @/ J, M0 V0 o
  
- B) |0 R! u9 _1 d1 a, m/ B; S0 F   ValidLabel = lbl . Y) Z  @8 W) q* W
End Function
4 V& ]5 K* h8 x+ H, s5 k3 t  
& b5 _8 p- b: ^7 u# j'***********************************************************
5 Z0 T% ]/ T- U. S" w'* PrintCookiesInfo
& |- E' R: E9 i'***********************************************************
0 M/ L9 [* Z/ zPrivate Sub PrintCookiesInfo(byval DivSetNo) : o. Z  K+ r& c7 V9 h% b, |
   dim tbl, cookie, key, tmp " ^% x5 t& q, D+ ]' ]- E: b3 y
   For Each cookie in Request.Cookies 0 j2 S2 d6 r! G" o' }/ m
   If Not Request.Cookies(cookie).HasKeys Then ' X6 I( U% l$ t" D0 T1 Q
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   + j6 {- [# @& q5 [; i4 e9 X2 h2 V3 _
   Else : M+ x# a3 P( [1 x" Z
     For Each key in Request.Cookies(cookie) : g0 R/ m9 r4 K" H: N" E& _
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. $ [' e  |6 P! ^! T
Cookies(cookie)(key))   & {  F' P0 V. B8 U
   Next
% L$ }. u2 }& G   End If ( i$ E* v( X! X; N( X3 I
   Next </P>
5 }+ I) B' q  \<>   tbl = MakeTable(tbl)
8 z& G/ P, p. Y8 \, T' P   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
! U- J  P9 o! Z9 O* u) A   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
5 m" _7 T% c- J3 O. {% W! l   Response.Write replace(tmp,"|", vbcrlf) 2 M* ]; |1 o& w1 S( o, T- ^1 J
end sub
  F6 s8 K9 e6 G- t- u  - O0 [& ?1 S8 `
'***********************************************************   H" J6 |  w9 J1 r7 _2 ?5 g
'* PrintSummaryInfo
/ _6 u- O& C* {( ^5 Z+ u, Z0 k'***********************************************************
) _0 B) E3 L1 _  g7 A+ _) gPrivate Sub PrintSummaryInfo(byval DivSetNo) " j. a; f6 R  Q' ^
   dim tmp, tbl
9 u- R: _) ~- \2 K( j   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
6 F* j6 p( U/ T% [4 x8 Y" t   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
4 P& T( P# ^& q3 R   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) $ \2 @4 {* }; C7 n- C# ?9 m, C
   tbl = AddRow(tbl, "Status Code",Response.Status)
2 M' ^, [1 d' t   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) & R% q3 @5 g  [. V7 X8 t# e" X/ Z0 g
   tbl = MakeTable(tbl) 2 W  ~6 Q* i* q6 ^8 F* Y8 e$ b
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
/ n, b7 y: Q! X, F. `) {   Response.Write replace(tmp,"|", vbcrlf) 3 ]6 C0 s  s0 _
End Sub </P>/ A) g; u% |3 H
<>'*********************************************************** ! n. l$ D. a& x
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
* j, Y" K0 V/ W- r8 K+ E3 W) A''@PARAM:  - oSQLDB [object]: connection-object " J5 x; |9 I5 v! z6 F/ l. }
'***********************************************************
3 ]  @/ ^8 I: Q3 ]' \% y$ OPublic Sub GrabDatabaseInfo(byval oSQLDB)
+ j4 ?- H# B/ w# I+ t3 F6 `   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) ! T9 q. r' b% Z! y
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
9 G  s$ v- Z; {8 }   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"))
' b$ B7 q) i7 o7 c" h( |   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
1 I0 A! o$ R8 J) Z' @5 p" ^9 x2 ?End Sub <>'*********************************************************** , v1 \: e6 y0 {& \; o: q
'* PrintDatabaseInfo   g" U6 x" l: @% r" m* _
'***********************************************************
8 z/ q# H5 E- M2 OPrivate Sub PrintDatabaseInfo(byval DivSetNo)
. q* x5 S( B5 w* y9 L   dim tbl 0 F6 H0 \! d6 Y: U0 O. U* w* B+ D
   tbl = MakeTable(dbg_DB_Data)
. \1 t; H8 a( @3 \   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 2 M/ s: n6 @: z6 W" n9 J( q$ m0 b4 ~2 `
   Response.Write replace(tbl,"|", vbcrlf)
; w) b+ s! Z* P2 E! Z5 ~( vEnd Sub </P><>'*********************************************************** % w4 u- Y9 X0 W. i6 Q2 ]
'* PrintCollection
: j. Y: o5 f, ~+ a0 |+ A'*********************************************************** 7 q0 m9 S3 V* v
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
0 A. I$ @7 [( w6 u/ z   Dim vItem, tbl, Temp
' H5 ~4 k6 w$ i- D3 @   For Each vItem In Collection
  t: h  R+ F. o" l9 r+ n' n$ h0 s     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 5 u, v2 M4 A- e1 f* \$ J# u4 B
       tbl = AddRow(tbl, vItem, "{object}") : F- k1 C' U; a$ p% _9 H
     elseif isnull(Collection(vItem)) then
2 B) N$ u7 A% K       tbl = AddRow(tbl, vItem, "{null}") $ @- w! n1 X7 w4 u1 w4 A! ?, S
     elseif isarray(Collection(vItem)) then
3 E$ N3 b# J; r, \  o       tbl = AddRow(tbl, vItem, "{array}") 7 ?/ M, x  e* M+ H" F% d
     else
" ~6 Z$ k! u7 I1 ?8 j       if dbg_AllVars then : y1 c. S1 }+ ^) G2 y& x
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
4 N) u9 Z. |3 g: i     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then + I" Z3 d8 a4 h1 s( D4 i: F! M
       if Collection(vItem) &lt;&gt; "" then 2 o: @' t' [4 f4 M" V# _
       tbl = AddRow(tbl, vItem, server.HTML
1 R( U  \& R: I( N% ~6 c/ @Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 4 F0 T2 h, U8 q, ]6 ]" t
       else
0 F5 W( L2 A' y, y" W6 Z       tbl = AddRow(tbl, vItem, "...")
/ R* K, j7 t9 ^       end if
1 t6 s- y3 t! l3 n, G     end if ( N" T) _& c* C" I
   end if
& W1 v8 r0 R" m' g  c( O   Next # D/ R$ ]$ H+ e$ k
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
8 a( P) b/ `! `  l1 W( j   tbl = MakeTable(tbl)
% l) d. e; w. A( N   if Collection.count &lt;= 0 then DivSetNo =2
8 p) Z: t1 M& G     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : }5 w# n" \2 R
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ s% {2 J/ ?# W! \7 C     Response.Write replace(tbl,"|", vbcrlf) 3 |1 u2 d4 f6 t% c2 k1 D; S3 H
End Sub
' v, ]$ W1 b4 z! q! F: ?5 [& e  
, v$ W# \, |, a) `. A" l' f: }5 h'*********************************************************** 8 u! v' U6 W" q$ U
'* AddRow & C- z, [4 I# N7 J( \. y0 a
'***********************************************************
6 i; J5 U* U9 `- _6 V* ]Private Function AddRow(byval t, byval var, byval val)
/ W' k, R. b' M# {5 A. [' p   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" : ]% c3 E0 `0 n
   AddRow = t 5 ~/ v2 ~1 W" U
End Function </P><>'*********************************************************** ( [+ p$ Y# j  O
'* MakeTable
; u( z/ u7 v4 g3 G+ l'*********************************************************** $ F, o+ K* O0 X" R& v# E8 ]
Private Function MakeTable(byval tdata)
+ |; L5 p/ J+ n8 l1 i   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
4 C3 \. w+ C6 A% O* I   MakeTable = tdata
% L, }+ K) n/ M* b- uEnd Function </P><>'*********************************************************** / w  n+ R! O2 i& c/ C" l
''@SDESCRIPTION: Draws the Debug-panel
. x6 D; k9 J( {, G) Z3 F'*********************************************************** 6 ]+ K# x1 I2 j
Public Sub draw() % }( _8 B+ G, L4 A  B7 W
   If dbg_Enabled Then , U+ n$ r/ i& w7 u. z% L
     dbg_FinishTime = Now() 5 v: r2 @/ M# ]2 J+ L$ r8 ]
  
/ Q9 m: r8 x: e: J4 n   Dim DivSet, x : k2 }. I* ?5 S6 K2 o9 e
   DivSet = split(dbg_Show_default,",")
) H6 v6 U. O. z4 q) h) h" I3 }     dbg_Show = split(dbg_Show,",")
8 o- p  E/ E- e# ~  ^  7 j; v3 ?$ Q; `, t
   For x = 0 to ubound(dbg_Show)
5 N0 O' J* H: D% O/ k& C     divSet(x) = dbg_Show(x) $ p$ M8 p! R2 W6 M2 u8 U
   Next 5 d9 y" K, ^! p. x4 k5 w
  
& x8 L8 I. X8 ?( A3 O+ a; 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;"
2 I' F& l2 ^8 @2 H8 R* N! d   Call PrintSummaryInfo(divSet(0))
$ x: m& }' r2 q8 [/ n8 ]# ]     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 2 G8 s! ]7 O5 ~; U, o! |) i4 E
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
) d" K9 [7 l% |( R    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
7 r1 \2 \) p/ Y    Call PrintCookiesInfo(divSet(4)) & e  }4 L; @0 J. y0 u
    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)) 0 \* M! G; q/ f0 c! |2 [
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) F- y4 I8 O0 [: T0 d
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
! `& ~/ X( e' E8 K3 g# t    Call PrintDatabaseInfo(divSet(8)) 9 B* K; u8 K7 d  X% W
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ) }; e( N0 N% \' L' m9 a0 l' G7 j
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ! B. q5 K* O/ j) [" l. K( H
    Response.Write "&lt;/Table&gt;" $ H- _; k8 y; V# g
   End If
7 o- c$ [5 z8 q: G+ N( BEnd Sub </P><>'Destructor
1 V8 z0 B' c# e5 [7 X* rPrivate Sub Class_Terminate()
4 z9 c. @1 E* R9 ~* e( O   Set dbg_Data = Nothing " |5 }; L' l7 z1 i
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
0 G- F' ^6 B) W  W" G- k) ZCLASS debuggingConsole
/ D' Y  c  `2 F5 H4 w" vVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 v% J8 e& k1 A&amp;n
5 v" }6 ]+ @3 b) b  zbsp; ' {( x6 t4 K* L. ~
Property Get Enabled===[bool] Gets the "enabled" value , D2 P$ u) Z6 V% K# h
  
# O' @, R1 Z$ `+ K# w. Y/ ?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
. \! \% g# W1 L1 I8 @  : x9 Q- b0 s( t7 A5 i
Property Get Show===[string] Gets the debugging panel. $ p0 H% u* ~3 n  P
  
' y, S7 ?+ z8 H# R: |8 eProperty 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><>--------------------------------------------------------------------------------
$ D* o( _9 e9 }1 k2 ^2 ~Public Methods </P><>public sub===Print (label, output)
/ L; G& k6 H0 G6 x   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 9 N8 M: H8 T8 y4 S# X
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 2 t# Z7 h$ p3 D
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
2 k1 ]7 \+ X! z- cMethods Detail 1 i( T' u/ t# `5 o5 s
  
2 M8 X) @; g! x' bpublic sub===Print (label, output) $ r. N5 f6 U% v1 a' Q4 ^) j
Parameters:  
! @! t5 U- S0 j   - label [string]: Description of the variable
& Y. W! b$ a6 `4 q% \% i   - output [variable]: The variable itself ; P* z" {+ i; V2 S. v5 q5 N
  - W. a8 l9 |- }/ q. ^4 A" W' T
public sub===GrabDatabaseInfo (byval oSQLDB)
( v" y, \& v, ~: g$ a, N4 G! wParameters:  
( U" v- D" `; D4 y4 S$ h# v   - 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-18 15:59 , Processed in 0.452815 second(s), 57 queries .

回顶部