QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6415|回复: 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 k0 w7 L. x! I<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
5 {3 ?' u; R8 E使用方法很简单:
  u" h7 k5 T& e, G% ctest.asp </P>
4 p4 m/ h8 |; }<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
( q9 R; s/ G, \3 z% v&lt;%
! \, M! _2 r# H2 g! X9 P! Toutput="XXXX"
9 F6 b* j9 b, j8 D( d& Z1 f  ?Set debugstr = New debuggingConsole $ W) S4 P2 K& }. c2 Y) f4 R
debugstr.Enabled = true 0 L  O; e* h/ T% [7 J. |, z  g5 G
   debugstr.Print "参数output的值", output 3 o6 |/ a. r. S1 a
   '……
+ X$ A" }! Q9 C0 }   debugstr.draw
6 B8 W4 {" V- w- l1 i0 @7 P& ^Set debugstr = Nothing 2 f5 j! q8 t6 g
%&gt; </P># R4 M( ~* B: i
<>=================================================== </P>
( k! `$ o$ X$ G0 c8 b3 v) z<>debuggingConsole.asp </P>
9 u4 H6 N9 s9 {6 Z1 k; v<>&lt;%
* m+ U* H! ~1 s1 BClass debuggingConsole </P>* e. l5 x! Y+ e  w5 w
<>   private dbg_Enabled
# x* G7 `/ `- L' v5 O% J3 N% C' z   private dbg_Show . j* Y( t1 O! r" K3 z1 T3 Y$ Y9 S% u7 Y
   private dbg_RequestTime / E: }" R* I0 `( [+ o* ?3 {
   private dbg_FinishTime % E6 q5 n4 R0 R1 |' Z6 l
   private dbg_Data 3 q: x% I" I$ e& ]& P7 o
   private dbg_DB_Data
; \  q8 K, M* o2 Z& N: x- Q- n   private dbg_AllVars
7 d: I' g# }% _/ v   private dbg_Show_default
3 ~6 R" d" {# s2 Z' H/ P1 t   private DivSets(2) ) n) g$ _; M) ^, \! O
   9 a# g( a; c4 V$ @5 o
'Construktor =&gt; set the default values & o( g2 D( W$ k
Private Sub Class_Initialize()
+ _6 ?, i* i9 M   dbg_RequestTime = Now() $ ^* ?. @) I1 t# A0 J
   dbg_AllVars = false 7 c% d  a0 |: w
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
4 h4 S+ h: p6 L4 }0 j- w; a<>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>, ^" i' f. _- h5 p' Q
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;+ S+ V+ n# f3 ]& Q) y
&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 z5 |7 X7 |# h2 G2 _
<>   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>8 s& E8 l# X7 ~/ T
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
# _2 W$ S1 I  D6 \) oEnd Sub </P>
) z" ^5 y5 b- @<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false + N8 g9 g' [  S
   dbg_Enabled = bNewValue 5 V) n7 L, Q6 c5 F4 b
End Property </P>( x  q  I* K% C  o
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
1 f0 t6 {4 I8 {2 n4 _& E   Enabled = dbg_Enabled
4 z. t$ Y$ e7 d) NEnd Property </P>
' T- F( B6 c0 u3 C8 S<>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
$ u% _$ @$ Q5 U& \   dbg_Show = bNewValue 3 E# h% X. ?$ U' S. l$ ^  O$ T, P
End Property </P>) W2 X- N: J* i1 q( A# _
<>ublic Property Get Show ''[string] Gets the debugging panel. 2 |& G  e% b" q. w: s6 ~  s; p- b
   Show = dbg_Show ( w8 p: C: b4 R9 R7 q
End Property </P>. _7 K( Q0 c1 y! R
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
7 A! L' b) Y' \8 P# F   dbg_AllVars = bNewValue
+ L3 k, ~: c2 {' }/ H2 N) \( Z) q1 ]End Property </P>* q' B0 j- e0 R' D- W
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
: ], n0 {3 B# ^# L% C   AllVars = dbg_AllVars
( H( N- a/ s7 v* g5 VEnd Property </P>/ _( _9 F, A1 w* g2 G7 T
<>'***********************************************************
) k7 o7 _  w; a7 N( O7 N  s''@SDESCRIPTION: Adds a variable to the debug-informations. ; `, m& g% ~# O4 ]0 S
''@PARAM:  - label [string]: Description of the variable
. u( w- \( x# ^' k) m( L6 W5 A2 z1 W''@PARAM:  - output [variable]: The variable itself
! `5 j4 s4 E/ h# w8 F8 T& {* O/ N'***********************************************************
& s# a1 j4 V6 M# a6 c) LPublic Sub Print(label, output)
! l- m' u0 M3 r2 L2 x3 U5 o" @0 R   If dbg_Enabled Then 6 s) X0 X: F3 U5 H' c! v! a
     if err.number &gt; 0 then
! j! W; [9 I6 }$ M, b& H       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
1 R+ V/ g# m9 ?7 d' A6 M. R/ T       err.Clear ' ], x2 Y6 s6 H9 \( Y3 V4 K
     else
7 g% c: K8 h3 b$ k3 |! ^       uniqueID = ValidLabel(label)
3 e3 q& y/ {; {; _! C2 T+ p" ?       response.write uniqueID
. r6 ?! c  x6 O$ g; y       call dbg_Data.Add(uniqueID, output)
3 g- D1 K% ~  c3 f     end if
* B, ^: p& T# |   End If & F) y# q8 ~  @: n
End Sub   b+ H4 H1 f1 w/ j
  
4 r$ V* }& Q+ T2 z; I" U'***********************************************************
1 _3 l6 ^( v# f'* ValidLabel 9 F+ G+ z) C9 |7 a
'*********************************************************** ( l8 @$ I2 Z5 O2 o1 E
Private Function ValidLabel(byval label) : Q4 V) y) q" P) |2 K( ?) X" m# a
   dim i, lbl 3 f! Y. i8 Q3 n* C' a4 G
   i = 0 8 Q6 M. ?% c. Y
   lbl = label
' k, C3 h% l, C) C3 h   do
. r" a( f8 @+ g2 B, ]% I" w! X   if not dbg_Data.Exists(lbl) then exit do
5 ?& e, I9 N9 G( d6 k   i = i + 1
3 }$ l6 o8 c8 d% ?8 m3 n2 G) e   lbl = label &amp; "(" &amp; i &amp; ")"
, W1 B5 M) z# h* H5 J. a. A2 M$ U   loop until i = i / l: P6 x% W! l1 n' M( J, ~
  
5 u6 w) ?; R. _/ s   ValidLabel = lbl
/ c- q. m# C) ?6 ^6 NEnd Function
1 s2 s& V( }4 J. ^- X; V, l4 ]  
5 C: b9 r1 G4 l( {% T'*********************************************************** 7 y8 |) K2 k! d. e! @, L4 V0 ?
'* PrintCookiesInfo
3 J. }1 \; Y# _9 ^- q. x5 }'***********************************************************
; Q  U0 U4 d; d; U* B$ oPrivate Sub PrintCookiesInfo(byval DivSetNo)
0 g5 n- f' t- c2 ?   dim tbl, cookie, key, tmp
0 E" _! x4 H, p& Z# p* W   For Each cookie in Request.Cookies
9 w$ C" @! L6 |8 p! y   If Not Request.Cookies(cookie).HasKeys Then
5 B" X; ?: m# H9 T& E; K     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   $ q/ _9 Z; V' }6 u1 E
   Else 1 ^& C( `6 n: x. q9 Y- P
     For Each key in Request.Cookies(cookie) * I" j: J' W+ [& U& P2 x& ?! \
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. & V, B9 w$ G: h3 N# g* B3 V
Cookies(cookie)(key))   
* n, B  w* _  L% O$ M   Next + Z) y6 `5 {2 P2 v; L- }
   End If
0 ?) w. Z8 G5 E  ]0 N$ w   Next </P>5 ]+ w' E2 y# w5 Q
<>   tbl = MakeTable(tbl) 9 o/ g+ p' N4 s/ h
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 / y0 {8 u+ s9 Q( k" \& H6 e' {5 S
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ; T- l3 H0 u$ b8 W' S0 ^
   Response.Write replace(tmp,"|", vbcrlf)
! v; S+ c9 }. Yend sub
+ U# s) V) m. P! W  y! V. |  
" Z. C$ t$ y: W- z'***********************************************************
, w: a2 I7 \4 L4 Z'* PrintSummaryInfo
! X  `5 q4 T; w5 V% d/ H'***********************************************************
  Q  N) [% w8 r0 L, c4 EPrivate Sub PrintSummaryInfo(byval DivSetNo) ( k: ^; q+ ?1 _9 J0 X$ G- M$ t7 h
   dim tmp, tbl
. o0 C" ?& l( |3 E( W- C( A' }" e   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - m( u- m2 V8 @" E
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
# J/ w5 @7 e2 m1 A   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
5 z. g. P9 e3 l   tbl = AddRow(tbl, "Status Code",Response.Status)
  F. ~) }% w; s5 _5 r4 }0 N& C   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) & ?$ n6 x0 @$ F+ @
   tbl = MakeTable(tbl)
: K) b5 R; ?) M! Y& D   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) . F* i% O8 ]9 G) i" n# ]: W
   Response.Write replace(tmp,"|", vbcrlf) / Y. k0 D! a7 e* ]
End Sub </P>
' c+ b8 O' n) x<>'***********************************************************
9 t2 l+ y8 p+ N8 u$ E''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information # j# F3 m4 d. {" e2 U- q
''@PARAM:  - oSQLDB [object]: connection-object 0 J4 w& l' j. A6 _% Y5 X
'***********************************************************
$ u+ {- n4 G# A# WPublic Sub GrabDatabaseInfo(byval oSQLDB) / \" \  n* @7 C- F+ \& A
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) + _' {! j, L, @; n4 c; c" r( b
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
( b7 Q) \. v! ?$ e3 I% v) @, g$ C   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"))
: J, U: N  U6 {9 a* s4 x  _   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
6 B6 a) B$ d, q4 R1 y4 _End Sub <>'*********************************************************** 8 [1 i6 i6 H3 D: o
'* PrintDatabaseInfo
3 e% _# ~% F/ V# C6 L: @: B  N'***********************************************************
9 y$ c6 g) i9 lPrivate Sub PrintDatabaseInfo(byval DivSetNo)
/ T  J9 ?5 v% y. b' f   dim tbl
' F' W- J; S* @+ s   tbl = MakeTable(dbg_DB_Data) & H9 H; _, G# o1 K: ~7 K
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# _% _7 f& P* m9 A   Response.Write replace(tbl,"|", vbcrlf) . b9 g  s9 O5 ~& y- C
End Sub </P><>'*********************************************************** * y: W' Q7 B0 O. }! w
'* PrintCollection
" Q& Y, V0 v. `- P4 {. O$ I9 V6 X'*********************************************************** ; T! @1 m0 U. J5 L8 _, K
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# ^3 d, J' N5 T6 G$ V8 J( N8 e   Dim vItem, tbl, Temp
1 f; m! h; g+ |  d! @: v0 P+ t   For Each vItem In Collection
2 K/ _( E; B/ ?4 ^6 a7 z+ [& K     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
7 F! L3 s1 y! P9 g       tbl = AddRow(tbl, vItem, "{object}") 8 |5 ^* u4 @/ {. U3 Z
     elseif isnull(Collection(vItem)) then
0 o3 l! u4 f, O  i; `7 ]       tbl = AddRow(tbl, vItem, "{null}")
* D' r% V6 j5 p6 f* ^7 I     elseif isarray(Collection(vItem)) then
1 Q: T* T+ y& F( s/ c0 c* _       tbl = AddRow(tbl, vItem, "{array}")
/ ?2 f4 Z  }9 `     else 3 B2 q, y4 E) {* a: C
       if dbg_AllVars then 4 A  w( P+ B  O- U; N8 D  J+ j4 o
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) $ r: R7 f6 K5 N; i3 F9 H
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 6 H- K! D( o) v7 D$ [: K( c
       if Collection(vItem) &lt;&gt; "" then 6 E  k" ?8 Z; e4 R8 e
       tbl = AddRow(tbl, vItem, server.HTML; k- P/ j' A; r' n+ v
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") # u8 B, j% x# C
       else
) A' @7 K; z/ B- ?3 o' ^* a- [- r       tbl = AddRow(tbl, vItem, "...")
: D* L$ }9 J8 u1 n) T$ e3 F+ K( f; C6 U       end if % e( x% V1 v9 u( E/ v8 {$ q3 j8 z
     end if . H  f' y4 u2 F! S: g9 H
   end if ; v2 x0 t6 b; z
   Next
- P) n% i6 v; J+ z   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 d, ]9 a0 D0 F. f  k# e5 U
   tbl = MakeTable(tbl) % g; }. p8 M" M; \4 ?1 _
   if Collection.count &lt;= 0 then DivSetNo =2   P: g% [' D. ^* L
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 6 q; H6 o) `0 ]  Q1 i
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
3 E9 b& Y$ O# o: E7 h4 H     Response.Write replace(tbl,"|", vbcrlf) 3 v- x$ B( O" R
End Sub
6 c6 v7 x- s1 f/ p  
% f- P5 k9 U2 u'***********************************************************
  N4 y! r/ w( ?8 V) _'* AddRow . d* D1 k* J7 s- v+ h
'***********************************************************
( z2 g+ e  C. |  U, jPrivate Function AddRow(byval t, byval var, byval val) 6 Z& R' @! |5 P3 i2 R4 ?2 f
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
. M2 o( T! }& g+ A( G   AddRow = t : ~. ~) E' L/ z  b
End Function </P><>'***********************************************************
6 d" d7 q0 ^7 G. I'* MakeTable $ j- S, P" V- ?" f& r
'*********************************************************** 9 ~% S9 R1 O+ P4 J
Private Function MakeTable(byval tdata)
. G9 [9 H" U  n5 a   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" / B6 \2 @+ @2 W' `, |/ \
   MakeTable = tdata
3 ]8 f' Y3 X3 }3 r4 s- ?8 F6 S+ _- MEnd Function </P><>'***********************************************************
( w+ I* U5 G+ D5 n6 p''@SDESCRIPTION: Draws the Debug-panel 4 h$ Z- U8 w9 u) h, f3 Q2 H
'***********************************************************
3 Q. m: m( G0 f( n* J2 v2 Y3 m/ jPublic Sub draw()
, z; z6 `- q9 b3 L1 s   If dbg_Enabled Then % C' ]6 M* t9 Q# V$ C
     dbg_FinishTime = Now()
5 ^' u: p9 {, u' T; |8 V: w  
' b# Z. {3 w# X( A9 F1 {: N$ W   Dim DivSet, x 9 T. J6 A1 R4 m0 v4 c' y
   DivSet = split(dbg_Show_default,",") 3 z0 z7 S; O9 o5 j4 G
     dbg_Show = split(dbg_Show,",")
$ i% A$ o6 g8 J3 s( Q/ p, X  : w( N3 i" O; X9 D$ \% O6 c- y
   For x = 0 to ubound(dbg_Show) ! x# ~1 Q" b1 }+ N
     divSet(x) = dbg_Show(x)
: f4 k' T& }, d6 g# j; n, b  w   Next , {% B/ F/ X6 v5 x3 C1 E. }
  0 g2 e/ ^% b+ ^0 `+ I% V) J  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;"
9 V0 J! y) U- B, W   Call PrintSummaryInfo(divSet(0)) & q' E# ^# P3 Z: ?$ U8 @( n
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") : m* U% A$ ?4 G5 F$ Z2 e
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") * D4 O5 z" |. [3 r- ?) k$ F* k
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
" B/ T2 w  R! q4 i/ N- f! L    Call PrintCookiesInfo(divSet(4))
! Z# n6 F, j$ i2 G    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)) . ~6 g. i4 l+ f' k
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" J6 H7 w  M0 o    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ; v; S4 F2 R2 Z. ]
    Call PrintDatabaseInfo(divSet(8))   U; N; S8 o8 [# }4 Z
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
9 g8 r4 l6 f$ d8 e! [. p    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
4 H2 p% ^+ z6 F" n    Response.Write "&lt;/Table&gt;" ! r4 t: [! _- a: P7 G) D
   End If
" G7 u& h% p  h. D& R& P2 SEnd Sub </P><>'Destructor
; m. E8 i" g6 l4 ~% V0 HPrivate Sub Class_Terminate()
$ m; F8 m0 f+ J) h: K% R   Set dbg_Data = Nothing / X9 l. c; z! W+ R# |. L$ ]3 C* r
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>- O8 ]: ~) I! y9 u& a! p+ P
CLASS debuggingConsole ' X3 [8 i2 d7 o8 {
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
+ u  [9 S  Z, D. [&amp;n
' V8 D. t. W3 F! \bsp; 4 y5 x: \8 X. @$ g+ C- O# ]
Property Get Enabled===[bool] Gets the "enabled" value 8 j: K, u% H) O- O' B
  
7 x; X2 L6 O: h. c0 _- }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
1 z' x2 B1 w: Z# Y  . x9 X: s3 \* |
Property Get Show===[string] Gets the debugging panel. ' |" E! ~: g3 i% D4 Y6 H1 I* L
  : Q) I4 ]  y4 t6 Q' `
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><>-------------------------------------------------------------------------------- , @+ j4 Q( s$ A6 h
Public Methods </P><>public sub===Print (label, output)
0 f/ E' ?/ _9 W2 G8 I& ?7 p( l7 Q   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
; S, F7 k: F6 i$ q+ x   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
* [# L* c' H# p+ H+ ~+ y   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
# {  J! ]: H! [& m" BMethods Detail * F; {" k% B  O  O
  ( ?' B0 g: C% A
public sub===Print (label, output)
+ C3 Y) V; R. x+ G3 HParameters:  
$ k# S4 M8 _( b/ |, k   - label [string]: Description of the variable
% m0 W% O7 K" o) ^, ~' E' T   - output [variable]: The variable itself , f# g. \& e- z) _
  % j. ^+ L! g- e6 U
public sub===GrabDatabaseInfo (byval oSQLDB) ) u7 d3 U# k1 e8 c; T: F1 N
Parameters:  
+ ~% W& N3 m3 f# H' O% G  R+ U   - 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-11-27 09:17 , Processed in 0.421563 second(s), 56 queries .

回顶部