QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
0 Q; O; _9 c  n, A  A" j3 K<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ! i7 w: w0 S* x0 p/ w7 P' v
使用方法很简单:
0 X* i  e, z: ttest.asp </P>3 e% `6 [, {$ u. o  P: d
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
# p( O0 E1 A( e' {1 b&lt;%
( A# r' f. {5 \6 v, o$ ~output="XXXX"
% l9 c8 F9 H- _' }Set debugstr = New debuggingConsole
5 q. i& v8 u3 I; H7 w  adebugstr.Enabled = true
1 g; T1 \) v+ b& S0 a8 J6 i   debugstr.Print "参数output的值", output
3 e2 \8 ]! r4 j" |- P   '…… & S/ q! c$ n3 z9 s1 Y
   debugstr.draw 5 s. R: \9 d, R4 z& {7 g* H
Set debugstr = Nothing : {" a* w5 L- T% R. i* ]* N" v
%&gt; </P>/ |; o9 Q/ u' j/ [1 N6 {! {
<>=================================================== </P>/ W" K- V) R% d! i$ E" J
<>debuggingConsole.asp </P>
9 U- d. `1 f2 k. t# Q% I<>&lt;% 3 M% a+ q& x# B! j3 C$ `% }
Class debuggingConsole </P>
& T% G, U" y3 P9 N# x$ W7 L2 Z<>   private dbg_Enabled 1 e! A6 y# f. L0 R# E
   private dbg_Show
3 h# Q  N/ k, N6 i   private dbg_RequestTime   c. e9 G- ?8 E; q$ o. m
   private dbg_FinishTime 0 S- G- ?. j8 i+ J9 U3 z
   private dbg_Data 8 n; m$ |+ W: Q+ s
   private dbg_DB_Data
: w/ p( T  k3 e# j0 t   private dbg_AllVars . H7 {* g9 C. O" H7 a
   private dbg_Show_default & G& ~& h5 v& ?# n& F* w) a
   private DivSets(2)
; G! U, ^7 _1 \% W* r% r   + w4 r: H4 R& U# ]! L4 L) y3 k
'Construktor =&gt; set the default values
# C; l' P1 w  W' E2 W; RPrivate Sub Class_Initialize() , B. d3 V' D0 o! M! K
   dbg_RequestTime = Now() 7 D) ]5 j. t$ n' r
   dbg_AllVars = false
$ i* Q  p# w2 m9 ?7 e+ @   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
4 U% W3 y4 e4 w$ |2 r# f1 ]<>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 z5 @: g) i% X0 x: S# B  Y<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
4 h5 J9 `- B& }&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>
" F. j5 R& G. p" \( P6 ^/ f! f8 |- y<>   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>) r' N% e" H, `& \" b  R+ J. ?
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" / [( u3 o! _. N6 E3 y7 I
End Sub </P>5 o0 {/ u6 t; k$ T
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
. p* R6 ^: m# @# F2 ?& p   dbg_Enabled = bNewValue
0 d. w  s2 R. a5 k, `  JEnd Property </P>1 s" I* P9 B( Z; q$ j1 i. I
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value - J* b0 H/ T1 c/ g- x' F% A, f( C
   Enabled = dbg_Enabled : d9 _# r% t$ \. g
End Property </P>' k1 D* U  y; |
<>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
! r: B% J3 [) X0 M" `& b   dbg_Show = bNewValue
, W) x; \. h  ^% oEnd Property </P>
$ L- t0 T' g0 b$ W<>ublic Property Get Show ''[string] Gets the debugging panel. 1 P5 }0 u; c' C& }& ?# h6 Q
   Show = dbg_Show 1 J& S0 R/ S1 Q  U: _) V8 {4 B$ o/ j
End Property </P>3 z" l( i9 m: \4 \1 `
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
3 D- O9 T- `: {1 x- s/ Z, n; h   dbg_AllVars = bNewValue   \2 c9 m' q; f2 f0 T
End Property </P>
/ o9 Z8 t3 V, S) s. v<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
; t% P! l8 Y) S2 b: O" r; i' S   AllVars = dbg_AllVars # f( b- {. _9 G% I8 A4 N  v/ F
End Property </P>4 {1 q9 {7 E. {
<>'***********************************************************
2 V) u+ W3 @, H''@SDESCRIPTION: Adds a variable to the debug-informations. 7 h6 ~- W1 {$ M" {9 B7 ]
''@PARAM:  - label [string]: Description of the variable
. A$ p; m$ n3 Z' ]5 X. d7 v/ E/ A7 Y''@PARAM:  - output [variable]: The variable itself 0 Y. e' m; V/ @3 D
'***********************************************************
6 n; P' a. H9 J8 YPublic Sub Print(label, output) & T  A3 s2 X  R9 j5 U
   If dbg_Enabled Then
/ b. @+ d9 L, d2 \9 g7 H8 h4 ?+ `     if err.number &gt; 0 then
6 H" A; T3 X$ w# c: c. P; w       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) . f: H) ^8 u; K2 Z
       err.Clear
% j( |2 t3 G# Y/ ]     else
6 b( t8 U5 b1 w1 O- ^+ X       uniqueID = ValidLabel(label)
) w7 k6 e/ ]3 S4 b* Y       response.write uniqueID 7 R" D9 ~% d. v( C7 g% ~
       call dbg_Data.Add(uniqueID, output) ; c: b- c2 U% K5 t0 P4 ]) s
     end if : G6 t5 `( V/ J7 `! o, o
   End If
2 B: n) z5 Z6 v  \! R5 bEnd Sub * j& T2 \3 `! ?  t, o, q
  % w. k0 H) ~, D
'***********************************************************
6 _# Y. ^4 {8 C/ }' e'* ValidLabel
! y; }3 r( m3 N* t# W# {2 t8 X'***********************************************************
/ K9 E4 g! J, |% nPrivate Function ValidLabel(byval label)
7 T( b9 l- a# U, l" M5 f/ I   dim i, lbl " c$ d! V+ ?/ b5 f2 t( d7 \
   i = 0 ) C; b6 t. B; j) J/ H( Y
   lbl = label . d  {  s. P* R, x5 a
   do
  V5 x- c' L% b- H- t8 m- r/ m1 ]  U   if not dbg_Data.Exists(lbl) then exit do
) T; ~: X, a* }# y7 D( U   i = i + 1 6 l$ K% |( R0 w- |( b6 ]' r
   lbl = label &amp; "(" &amp; i &amp; ")" 7 E5 r4 e9 e/ t3 Y% G8 Q
   loop until i = i
& f& Q9 v4 h5 q! ]' {    C. }6 @2 M3 M3 d# J" c% o9 w
   ValidLabel = lbl % r% C3 p" T; J( N
End Function 7 M; B$ `5 k- i% H6 y" ~
  
& D& b1 L6 N" n1 d5 l2 ~'***********************************************************
7 Q8 V0 P; L$ v- Y* T* n( B'* PrintCookiesInfo
! k( e& u& y4 O1 e" U'***********************************************************
  i$ o% l8 v& zPrivate Sub PrintCookiesInfo(byval DivSetNo)
: J, F/ a; H% m5 f4 e   dim tbl, cookie, key, tmp * q* W$ r  M. @& a% \. w
   For Each cookie in Request.Cookies 8 S1 H7 A+ w/ g3 [- a
   If Not Request.Cookies(cookie).HasKeys Then
" x" {4 G4 ^( c     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
5 v: ^- a# R/ I7 ~0 O: J   Else
" q9 w% i) M/ A% x' n" n7 a) N     For Each key in Request.Cookies(cookie) ! J' f- \, K5 H* u8 I0 T$ S
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
; r1 C% i+ P/ [  M+ `7 MCookies(cookie)(key))   5 R4 ]* p) z9 N
   Next + d; s; X- o7 {$ L5 J, k* x2 w
   End If
1 Z0 l8 F( N+ ?" Q/ r: b   Next </P>8 z) |8 n, ?( q$ q& G0 X0 Z
<>   tbl = MakeTable(tbl) # V! @  _. o: V5 d1 w$ b% }
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 3 y7 y5 X  V4 U$ r: B1 K9 M# p6 `# H
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
/ \* E/ D$ x1 |; Q9 B   Response.Write replace(tmp,"|", vbcrlf) 7 H; F! p& Y  l: c! G" n  Q
end sub + e, C/ x7 l3 ^0 U
  - C7 J) f# v3 `6 m$ k8 C  N+ g
'*********************************************************** 3 g' G/ `' G  `) y$ [) h4 Y
'* PrintSummaryInfo
2 s! Q( I, N6 \6 C'*********************************************************** # j1 t. z" l. u# |5 v7 m$ b- q+ l
Private Sub PrintSummaryInfo(byval DivSetNo)
! B3 U; W# A" E( F   dim tmp, tbl
# Q& @1 _+ v. q$ h% N. A   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
- G$ [  T3 }: b1 ~$ b   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 6 m2 t5 N7 e2 \- ~8 U2 z
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
% A) K5 v9 A7 ?   tbl = AddRow(tbl, "Status Code",Response.Status)
5 \9 G, Q: g9 L7 k6 ~   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
! F  @+ L  s* ?: y( p5 I   tbl = MakeTable(tbl) 1 l: X) ]( w: V1 o0 d
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
5 n: h  C' r; R, p+ B5 {3 N   Response.Write replace(tmp,"|", vbcrlf)
% _% X' g1 B9 d, G( ~5 M# CEnd Sub </P>" [7 _6 s' U- J& _% D2 `
<>'***********************************************************
; r& T( H7 y0 q" a2 h''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information , m) Z. [: }6 h2 R4 R: x- c9 e8 H  I* Q
''@PARAM:  - oSQLDB [object]: connection-object
$ Z  y* b0 w" Y) V( c, I'*********************************************************** 3 s  I( f2 o7 M) `
Public Sub GrabDatabaseInfo(byval oSQLDB) # L0 D/ c1 p1 O( g5 r: S
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) $ M2 t  y& S2 e% F! z
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
, V( c8 l9 o$ H$ n; v# {   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")) $ k4 A2 r) a! K% X" t5 W
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) - d2 x4 I; N6 A: u4 ]" Z9 w
End Sub <>'*********************************************************** ' B- w* x; Y+ H0 J  n
'* PrintDatabaseInfo 1 o# j  S  g% X2 V
'*********************************************************** % r( {' K0 V# }' [7 `8 ~
Private Sub PrintDatabaseInfo(byval DivSetNo)
  M: n- s0 W% g   dim tbl " C# l  v6 f; y+ v
   tbl = MakeTable(dbg_DB_Data)
' U( u- V$ x! o" C3 S   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 w( `: F' ^8 F2 z& f/ F
   Response.Write replace(tbl,"|", vbcrlf)   a6 ]" u( t. e- ?# j1 L
End Sub </P><>'*********************************************************** 7 a- {- w7 B7 O$ m0 \
'* PrintCollection
+ s* M# ~: u$ Y; F" e$ }8 ^& n'*********************************************************** ; d# Q7 a4 _- M3 c
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 S, q! x% n0 F" R7 J' f( @+ I   Dim vItem, tbl, Temp ( r3 ^3 @; |& E' H  N
   For Each vItem In Collection ' p9 {+ P' o$ h0 D' i% k% J
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
) X) f, z# p6 J# w6 f       tbl = AddRow(tbl, vItem, "{object}") ( ~$ y% r( g& |. s% _
     elseif isnull(Collection(vItem)) then " F% s9 m1 R# w7 b8 A. B
       tbl = AddRow(tbl, vItem, "{null}")
6 C/ i) f* z: {7 Q, m     elseif isarray(Collection(vItem)) then $ T# W' w* S3 {6 G- O( R
       tbl = AddRow(tbl, vItem, "{array}") $ O: }% U# U( I0 ]0 Y
     else
4 D  w; N& m, H$ q$ v+ j; \* e       if dbg_AllVars then
6 k7 x. z+ V, ^" r       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
3 Q& C& E/ I. Y5 [. D! {5 V; t  C     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 5 y; i0 H- N: A
       if Collection(vItem) &lt;&gt; "" then % |; {7 N" H4 C
       tbl = AddRow(tbl, vItem, server.HTML" s* S, |- W) h; w
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
: B1 [( l$ Q' N; i: U4 R3 T! C2 ~       else
3 P' d& d' L) `' l3 m( l       tbl = AddRow(tbl, vItem, "...")
3 C8 ^7 r, x) i8 K: z& m       end if
; m& ?+ @+ T4 j/ p  R: z     end if
+ n9 `% @3 e; o/ O4 L7 O. C  G   end if ' E# X- h: u4 U; H7 h! C3 ~3 ^+ o9 |& i- W
   Next . ~& e  |: W" i- l2 _5 {. b  g) 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 1 g- k0 l0 ~  {( ]
   tbl = MakeTable(tbl)
' H2 K% b1 V( r. ~* d2 y, q   if Collection.count &lt;= 0 then DivSetNo =2
1 Z* _' s7 P  m+ C6 m1 c     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
+ O: h4 t5 f: u, U/ A2 E     tbl = replace(tbl,"#sectname#",replace(Name," ","")) & v& ?; P$ N# E
     Response.Write replace(tbl,"|", vbcrlf)
5 O" ?2 q, n  cEnd Sub ) w8 n' ^" g' N- j3 i- x  T
  ' G; u; i/ @0 J6 o1 g% `: X8 v
'*********************************************************** ' G. V1 l  c9 K$ L5 I6 a# p
'* AddRow
; X2 u5 S* G3 c( y7 h'*********************************************************** , g/ K, r2 ^5 ~! M, C
Private Function AddRow(byval t, byval var, byval val)
- _# C, X7 p/ a9 E2 g% ~   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 5 Z; D  B# Y4 x
   AddRow = t 4 ?& e9 Z  ?, W8 @- z$ y5 \
End Function </P><>'***********************************************************
4 b" U) r0 V" F& v5 J9 X'* MakeTable 7 A. L0 P5 N/ T
'***********************************************************
) k$ v* z( F3 _9 G/ B2 ]Private Function MakeTable(byval tdata) 7 v% T4 R7 @; F/ W2 J. F, ~
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 7 g& \5 _+ n3 _3 V; }
   MakeTable = tdata
/ u+ J' W) Q4 a4 p1 e. j2 JEnd Function </P><>'*********************************************************** : J7 n+ e1 d/ z& y& c
''@SDESCRIPTION: Draws the Debug-panel
$ O3 ?: u8 }# T& ]7 n'***********************************************************
: z- T. G8 t2 w4 w) HPublic Sub draw()
, X/ V7 ]% |# d/ `8 i   If dbg_Enabled Then & |8 M9 a1 V0 Q; `/ @8 l( s2 O
     dbg_FinishTime = Now()
7 h3 Y  Z  E$ a! O* Y# w" r  Y  ; B& [, _( q5 r- A+ C( t( T
   Dim DivSet, x   R2 e- c* E& C' Q5 N  d
   DivSet = split(dbg_Show_default,",")
8 R: E0 H: G& G+ x" y* q     dbg_Show = split(dbg_Show,",") * o  S- p0 D2 g/ m0 ~
  7 n0 C5 @7 V. |. _4 A
   For x = 0 to ubound(dbg_Show) 5 Z+ u% c: ~! x# x$ e" r5 Z- z3 [
     divSet(x) = dbg_Show(x) + U& R! |9 L  B" @. g' @/ T
   Next
5 V" l# e+ C- }6 l  
& p3 f$ X. p% 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;"
3 R6 I) t, Z) t' h# L" H   Call PrintSummaryInfo(divSet(0)) 0 J  F$ O7 r7 R4 L" _
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: H3 s9 w* |/ \* @# H& U* Q, i  Q    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
6 O, c! i5 H% S* c) {' m* B  Z2 {    Call PrintCollection("FORM", Request.Form(),divSet(3),"") + d0 ]3 A2 D" z4 e; t4 I  e
    Call PrintCookiesInfo(divSet(4))
6 f: V# ~* D) l% n, |% x: ^0 p    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))
% Z: X& V* @& Y1 u1 c& O! t    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 5 Z( k5 f2 }* g3 l/ E
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' b  D+ @# D8 _( D7 J; ?    Call PrintDatabaseInfo(divSet(8)) & h3 y7 F/ E4 T9 ?/ }$ v! n9 |; P
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
7 M  X/ c! N3 @  ~8 A    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 3 T9 N3 R8 z$ r  h$ p9 J: i
    Response.Write "&lt;/Table&gt;" , M. N+ \/ f% w; P( z6 j  ^
   End If
, f9 t- x6 W3 P) v) IEnd Sub </P><>'Destructor 7 B4 ?! S( d% l1 Q( t
Private Sub Class_Terminate() 4 R  H/ P2 [1 g3 I- j. r
   Set dbg_Data = Nothing ) Z7 o; I% l) `" P4 F' Z
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>- a" y) E+ L; m. T
CLASS debuggingConsole
* E) M( D6 k/ p  T4 w7 q$ j: l# }" }Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) N+ Z/ t  Y2 ~) R
&amp;n
# Z/ l* p4 _& b5 tbsp; " P& \# B2 |3 z. p! Q. q2 Y
Property Get Enabled===[bool] Gets the "enabled" value & {- R4 C' `) h& [1 n3 S6 B' `, @
  
5 q( N! A) E( M7 f+ X, mProperty 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 ^7 n5 p: A! h3 K  * q3 w) ~5 c8 n* }
Property Get Show===[string] Gets the debugging panel.
0 p" K5 M2 T/ K7 _  
1 u2 P' T7 I. z, ?. g4 BProperty 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><>-------------------------------------------------------------------------------- ! e! @, i! e* r3 B  u
Public Methods </P><>public sub===Print (label, output) 0 I  t, M  t0 ^& `! x
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 4 f' S  x+ R5 @* Y* V
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
/ t$ l$ t7 p4 d9 Z+ ]' U% q- t   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
4 q! D8 j' |+ U& v% U- qMethods Detail
( Q/ ~" B1 h; I0 t! ^' O3 k9 F  9 c! z) a+ l" C  {
public sub===Print (label, output)
! S- ]% ?5 w; v$ uParameters:  & L2 Y* F3 _/ o! L: t
   - label [string]: Description of the variable ( u3 c$ u2 `+ r. u: l+ O
   - output [variable]: The variable itself % C5 A" m/ J, x' ^, }) @6 J
  ) b0 L+ M) `* J+ ]
public sub===GrabDatabaseInfo (byval oSQLDB) / @+ N. N- ~% s1 ^) ~8 H+ ^3 @
Parameters:  
7 Q) [0 z" |2 f. 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, 2026-7-18 08:40 , Processed in 0.304893 second(s), 57 queries .

回顶部