QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
) j/ s, W; U# y/ l0 J1 x/ n<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
% O! R9 U8 I1 J: H( {使用方法很简单: . g# |& J. r. W1 R; ^
test.asp </P>& S# Y$ S6 x/ ^$ m6 Q! e$ V3 q, S
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; / h" r& Q& `% ]/ }' t
&lt;% ; l% t7 z4 w+ Z3 f
output="XXXX" ! Z' L7 Q* o' I" u
Set debugstr = New debuggingConsole
: q  m: D9 B# _debugstr.Enabled = true   J% r$ K0 l; K) X  X
   debugstr.Print "参数output的值", output
- T" N6 i( v+ Z! I" m& ?- k0 b   '……
& P/ L8 B( Q2 U1 P$ h& B  t9 m   debugstr.draw
. H- E9 u3 s9 f: c3 WSet debugstr = Nothing : o4 w# ^: i! C3 o4 E- }
%&gt; </P>
/ P! B7 m- ]3 m+ }5 Z% g0 ~<>=================================================== </P>: v* S! S0 f" ~8 q+ ^; D
<>debuggingConsole.asp </P>/ b0 n8 r8 x/ r' ]8 z
<>&lt;% + c' b4 F' p8 [( U4 k7 Y- }6 r4 ~
Class debuggingConsole </P>
9 n$ a% k& w4 K9 J% C<>   private dbg_Enabled 5 C3 F: t8 z# |# C
   private dbg_Show
, f, z. r( x. l; x! |   private dbg_RequestTime
1 l: ]+ e/ |1 s8 q. N( w   private dbg_FinishTime
; p- }; p/ B5 S; C) e' T   private dbg_Data : Y9 U0 m$ x- T5 d' `+ h' P) n
   private dbg_DB_Data / e0 s: {* u- y0 a$ l% R! r' b
   private dbg_AllVars 2 w) s1 z3 T4 I% B
   private dbg_Show_default % o2 X* c% _. u9 J
   private DivSets(2) 7 `/ v5 t) ?1 l% R  k
   
! \/ j% a* t3 C* K( d  \: e6 r% @'Construktor =&gt; set the default values
! E; R3 t# j" T) r% i/ M* YPrivate Sub Class_Initialize() 8 c* D7 {5 s0 {+ z6 j2 ]
   dbg_RequestTime = Now() 9 d% S- Q+ C$ l, G% y0 y
   dbg_AllVars = false
! ?5 F* M8 s6 O. H/ J5 [   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
# ?9 Q% I4 d( c- z/ c1 t<>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>( N1 K' L9 a$ c# s* j
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
# |8 Q$ g2 L) [7 J) f7 N&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>
) [3 y! _' k$ q, t' 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>
; l- R% }8 {: v  X1 w- M<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
& W1 d/ [( `! f% S% oEnd Sub </P>
6 r! [* z  _5 E# }<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
& F: |. T7 {: \/ v/ S! r$ Q   dbg_Enabled = bNewValue
3 I3 [, a, `) m/ u1 r  \End Property </P>$ z7 ~% w. l" Q: H) V- W+ q- \
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 2 m* n) b8 W# g  q4 s. I; G
   Enabled = dbg_Enabled 3 {$ F* {4 W$ V( O( a/ ]
End Property </P>2 X! _" Q7 L. p' Z- M1 B
<>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 P8 I4 o( x9 O" `: V$ `
   dbg_Show = bNewValue
& d% }* x5 f/ gEnd Property </P>9 D3 Q& E  u7 _  {# A5 J1 [; n
<>ublic Property Get Show ''[string] Gets the debugging panel.
" K5 `# u4 q2 C: U( M8 j5 y   Show = dbg_Show
' Z# z1 V: Z' S, J  A; {9 dEnd Property </P>
6 X& J- Y4 r7 m2 [4 {$ ^9 ?. Y0 t<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
& n+ \2 V1 {! ?! z$ H   dbg_AllVars = bNewValue & L& k" L) z( L8 [
End Property </P>1 h: K8 ?1 W% B) Y0 j1 L# `
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
1 ~9 M0 |1 C8 I1 B& N! m   AllVars = dbg_AllVars
, }$ Q4 S9 }5 h, BEnd Property </P>
) F# K5 a0 ?" Y! h6 r<>'*********************************************************** : s- U3 @/ b0 ]+ h9 x2 I2 f
''@SDESCRIPTION: Adds a variable to the debug-informations. " {: l* N  x4 D/ G
''@PARAM:  - label [string]: Description of the variable ) S+ S6 X1 H0 l! c! i
''@PARAM:  - output [variable]: The variable itself
  Y/ P8 A5 {, {! M; @8 l'*********************************************************** ' I9 r* O* T4 C7 B' ]
Public Sub Print(label, output) 2 v4 U! G; }" \+ E  n0 N
   If dbg_Enabled Then
4 @% q, J( C" c2 z6 \, V     if err.number &gt; 0 then
, L0 F! O+ g. k. E       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
7 u3 V. O6 B' E       err.Clear
& J5 y8 `% r7 \& @% J, ]     else : j& Z& J3 k3 h. M1 T  Z
       uniqueID = ValidLabel(label)
3 W0 m  g' I! i5 ^       response.write uniqueID & e, w  O' ^. q+ `
       call dbg_Data.Add(uniqueID, output) ! e4 x- W9 Z6 A! @5 Y8 g! V6 N
     end if : [5 @0 ^8 _8 J6 M' c8 w
   End If
; i- c. o, Z" z- h$ r/ K* oEnd Sub
* r  f% m, w% D7 ?  
, l, {6 T+ S5 T8 \7 {, p2 f'*********************************************************** . i* X7 ~# [4 r4 }
'* ValidLabel
0 m# n+ x4 m" L5 @'***********************************************************
) t! e6 w  N, d: JPrivate Function ValidLabel(byval label)
5 Z( p7 D- x6 ^   dim i, lbl
* {' ]: i, D' K8 U) G8 H   i = 0
4 A" B/ B; R$ L* d   lbl = label
$ X% X4 f: Z5 N( |. v- H8 Z   do ! b$ T5 P6 `2 O4 \, d( n6 R
   if not dbg_Data.Exists(lbl) then exit do ' H+ b# h, J1 |+ V8 o; ]
   i = i + 1
+ |' h, p; ^* x+ Q$ m4 v0 s   lbl = label &amp; "(" &amp; i &amp; ")" 4 B& O$ B7 d' p2 B
   loop until i = i
; }) I9 `2 Q' ^: M  8 a' A. |& _* n1 F  P& r4 c$ i9 p. g3 @
   ValidLabel = lbl " [& {1 }, K9 D# G
End Function 9 t% x2 Q7 d; A9 Q$ c7 M5 Y6 h
  
8 T# _) x, b. \. G/ v& B'*********************************************************** # x, v! R6 F! n. w! J* o# [& G$ H* ?6 \
'* PrintCookiesInfo
1 C( \' D* W* l( r( F'***********************************************************
3 U! o+ [$ t1 G4 ^Private Sub PrintCookiesInfo(byval DivSetNo) 3 r6 J( _! m" @! T! v" |
   dim tbl, cookie, key, tmp 5 P: V% G0 ~  d  q3 C6 E1 H; a
   For Each cookie in Request.Cookies
! u* |: X( \% _# q1 k* s2 }9 o: r   If Not Request.Cookies(cookie).HasKeys Then
; n; F8 [7 L- ~, }: ^) X, `     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   - Q' m: Y3 r/ V; k
   Else $ A7 N0 b$ ^* |
     For Each key in Request.Cookies(cookie)
* M8 P; e+ \1 h& t8 o- N     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. - U% F: d1 N9 S- d2 j
Cookies(cookie)(key))   
% W; N& D  H# N   Next
  z, k: @5 l6 ]   End If
8 v( G: n& T4 V3 N   Next </P>
8 w7 `; _+ l1 u% ]9 |9 O% H. L. `" n0 A<>   tbl = MakeTable(tbl)
1 {3 d/ i4 u! D: {3 ?$ s% {- b   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
0 _9 i9 j- S6 B5 U   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 6 @, L% G* ^5 R( f% ~3 z; ]
   Response.Write replace(tmp,"|", vbcrlf)
( d) f2 S  k! J! v7 Xend sub 6 T+ [+ t% o3 a* g
  
/ m9 _/ B  D) }- p'***********************************************************
* z/ I- H. d# h'* PrintSummaryInfo / }& W! T7 U" I' ~% F- D
'***********************************************************
( S$ `* \1 D4 f  V7 Y7 h* JPrivate Sub PrintSummaryInfo(byval DivSetNo) : @. K3 V: v, x& Y
   dim tmp, tbl , c& L' f2 L# b' k! q' \9 i0 [
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
; ^) u( m& U. b, [& e. m   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
+ Z) z, N. r2 v/ d- K7 q" z   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 6 z- P* N, r8 U0 m$ M; [% c
   tbl = AddRow(tbl, "Status Code",Response.Status) ) p8 |- N" g/ p5 l
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
# J5 u+ I+ e: x5 R   tbl = MakeTable(tbl) 6 Z1 T; p! {7 O+ I
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
1 H# Z7 Z0 @) t   Response.Write replace(tmp,"|", vbcrlf) * H; O( u7 c5 T4 j, R. P8 v
End Sub </P>
! H8 j; I; J& L4 r4 N" I<>'*********************************************************** 2 _. A3 z. d9 k$ R& E* K
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information . E5 X  h- u. U
''@PARAM:  - oSQLDB [object]: connection-object
$ Z3 m4 y. m' H9 R! i/ X8 s; j'*********************************************************** # j1 l  g" L6 Z& D: [8 r
Public Sub GrabDatabaseInfo(byval oSQLDB)
- {* q  q1 B+ x% W  A& n0 @   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
* ?7 @1 _% V) S4 |   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) , T: I. m- q; ~5 b* Q* k
   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")) + a- ]. B& t  C2 M& Y6 f  {' W# Q
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) # e# y6 Z3 m, b
End Sub <>'*********************************************************** 8 U" H% [2 y- \/ f# _0 G1 @
'* PrintDatabaseInfo - f8 X$ U5 @  ]0 F
'*********************************************************** 0 _, _3 R! b$ B8 |. R
Private Sub PrintDatabaseInfo(byval DivSetNo) " ~$ L4 [# D; p( e  z
   dim tbl
9 F& d9 k6 d5 @6 ~- e5 N2 ^   tbl = MakeTable(dbg_DB_Data) ) j3 \' v" ^# y1 o( p
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
' o  v6 G7 L2 |& A7 d   Response.Write replace(tbl,"|", vbcrlf) 3 x* ?+ I8 \8 ]4 H; f
End Sub </P><>'***********************************************************
/ H' h! z- S2 F'* PrintCollection
/ t4 t, [! D6 o% G: z' I'***********************************************************   m" o* E7 {7 R# @: A
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 9 A7 {( p8 n. P3 |
   Dim vItem, tbl, Temp $ a0 c2 k3 o, e- J& b
   For Each vItem In Collection
+ V; A, W* X* y6 z& L$ P. z     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
0 t% P. b0 G/ l3 e& |% G0 t/ S, o+ p       tbl = AddRow(tbl, vItem, "{object}") : L! I" x% `6 U: P! e9 V
     elseif isnull(Collection(vItem)) then 0 E( D0 r  }2 Q
       tbl = AddRow(tbl, vItem, "{null}") ) g8 o2 o$ z* L0 w% b  r: W
     elseif isarray(Collection(vItem)) then ; j  }& D0 N: N: b
       tbl = AddRow(tbl, vItem, "{array}") . P* X! G$ E* b5 C' w
     else
' W/ d/ ~$ v0 N( C3 w. a5 \+ c       if dbg_AllVars then 5 e, ~6 l- N$ G' w  c' ]7 K
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 0 U* J1 p# h/ O3 c- q* d6 r3 W. Z
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
2 g. K2 x0 B% X* R, b/ L       if Collection(vItem) &lt;&gt; "" then
/ T6 N$ \. f* ?6 o! v5 L       tbl = AddRow(tbl, vItem, server.HTML
. v+ F6 l$ f( c/ f" |2 e# ^8 vEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 6 q: K. N& Q$ o( x1 @
       else
. t# Z; v5 U& \' w       tbl = AddRow(tbl, vItem, "...")
0 \9 Z( v# ]- K+ i/ x9 [8 y. l5 K       end if
8 o  h# O( h/ i5 l7 d4 d2 N& e     end if ! G. `& Z5 q" O! Z+ R
   end if 8 o" D. s: N1 N: b5 H6 w' Y
   Next 9 \! S- f; H, ]/ E; l/ }! F% r: f( [
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
" D) G  U$ v, Y   tbl = MakeTable(tbl)
% Y( x5 Q# ?; L% [$ z   if Collection.count &lt;= 0 then DivSetNo =2
/ H4 T" O" ^: w5 A+ j     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * |. J: W) x/ \8 ?: h% O
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 O- C; P  G) h2 M3 w' P
     Response.Write replace(tbl,"|", vbcrlf) ( L1 L7 B, y$ _+ X- j8 |
End Sub 0 a  v9 ~! u6 `7 U0 l) ]0 u
  $ f3 [- r" a3 A; H5 J% n9 t
'***********************************************************
5 m7 _) @" X% I/ k& t. k3 W1 d; t'* AddRow ) t! U' \/ F0 ?( ^, u
'*********************************************************** * p  d  Z3 ]  K& u0 m# R
Private Function AddRow(byval t, byval var, byval val) ; m7 N# }+ U/ W6 B) r
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 6 \3 H6 W4 _# [; V8 u9 V3 K) ^; f0 S
   AddRow = t , @7 F, t! c' `! U8 u  x& ?
End Function </P><>'*********************************************************** # V  Y0 ^6 K5 s; U/ g8 Y: J' b
'* MakeTable
2 r) C+ q1 M2 L0 c! c' w3 E7 s7 I'***********************************************************
0 V8 W( S! U% E1 QPrivate Function MakeTable(byval tdata) ) Z- T" S1 I: w1 z6 T
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" " s' D& _4 ^* q
   MakeTable = tdata % Q) m7 F: V* ]- c3 ~- ?
End Function </P><>'***********************************************************
! i, G6 K% u, |0 r+ i6 d''@SDESCRIPTION: Draws the Debug-panel
, E' T- {2 G" h  u7 w'*********************************************************** 7 R( y' c" C6 ^  O  |7 X" l8 U% D
Public Sub draw() ! D$ r% L5 l1 w) `
   If dbg_Enabled Then 3 w' w6 g# E# I& w7 M( s2 `3 R2 i
     dbg_FinishTime = Now()
% l, n. B8 F+ x  
( ?7 ?* A4 X9 J# H5 x) A   Dim DivSet, x 4 G9 X8 Y* f- \5 k
   DivSet = split(dbg_Show_default,",")
) P' V; T- ?$ v& U     dbg_Show = split(dbg_Show,",") 0 u  @/ I) Q, H! n
  
# A# g7 q; ?( G  _+ G  S" ]: j, y   For x = 0 to ubound(dbg_Show) 7 b- X% Q; d* ?; m% `: W1 V
     divSet(x) = dbg_Show(x) ' q2 R7 r& U$ j- U( Z* M
   Next
/ [% n4 ]# `0 n, U& i  
9 I. d* e, o9 B( [+ l3 @& R1 W   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;"
4 j, y8 j0 l/ ?$ x# @+ e/ O9 M0 A   Call PrintSummaryInfo(divSet(0))
' B8 |9 W5 [" |" Z8 s     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* F! R. |  r% y    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 4 n# J1 e1 D0 T
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 b( `/ |7 s* P5 R    Call PrintCookiesInfo(divSet(4))
9 q8 J" s+ m3 n: d    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))
2 g( p6 p9 S% N, \    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") " \7 ?* ]" B. A+ i
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) : S2 h1 m9 M. B1 K4 Z, o
    Call PrintDatabaseInfo(divSet(8)) ' T$ w3 R$ H$ M& c& o
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
  l) x8 |3 a  ~# k) n6 l    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 J4 a# y2 i9 ^0 i: E' j. G9 e    Response.Write "&lt;/Table&gt;"
+ B. ?0 s5 m. Z   End If
* u. u' n7 [9 _1 VEnd Sub </P><>'Destructor
0 k7 c0 j5 @8 y8 k& KPrivate Sub Class_Terminate() ( q' L( E; S  q3 b. b7 ?
   Set dbg_Data = Nothing 2 W5 e: W" }& l" I/ k2 S% B
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
+ G; @$ G& O( o7 V* h$ H( rCLASS debuggingConsole
' v! b8 V0 o* v( o' W1 rVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
$ y4 T4 Z" X: A) Y: Z$ q&amp;n
% @. Y8 l) j- a7 N$ s& nbsp; : s, j! P$ M5 B6 ~
Property Get Enabled===[bool] Gets the "enabled" value
" n% R! U% U/ r% V1 r( B  }  7 ?$ l5 }% v& M8 U
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, d. ]) P2 C  
+ k% z+ Z/ L) j% B, gProperty Get Show===[string] Gets the debugging panel.
) n! X  z! K4 L1 e  ! j! g2 P1 f  |+ K
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><>--------------------------------------------------------------------------------
' d  E3 ~1 x. TPublic Methods </P><>public sub===Print (label, output) , f5 s5 D* P* w2 G. [
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 4 }/ Q# C5 y5 ?4 n
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 7 g8 A8 U( Y' r2 d
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- % n" ~8 q- ]' ?9 Y$ `
Methods Detail
" y! J. h, ~; H* @  + G8 a* x5 |3 I3 y
public sub===Print (label, output)
: O+ {" n4 @- V) m% |Parameters:  ; i' y2 i6 |* F& l6 Y3 V0 a8 n; @
   - label [string]: Description of the variable 8 W2 R/ q* s5 E) ?5 h
   - output [variable]: The variable itself
+ a3 W9 F. p$ }% T  ; [' L  \; P/ y0 n9 E8 [# i
public sub===GrabDatabaseInfo (byval oSQLDB) ) {8 h0 d, K$ x# P4 V7 w9 z
Parameters:  2 C5 V& @2 X9 Y* L) e% @2 S* n
   - 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 01:13 , Processed in 0.366710 second(s), 57 queries .

回顶部