QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6679|回复: 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 a2 H- O$ Z5 D# \
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( v( v! S$ U) z3 ?! O0 q, G
使用方法很简单: 9 v6 g! ?' Y6 h0 }4 q
test.asp </P>* N/ P  P2 t- `& h9 G* M
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
, E3 J3 ^  {  X4 A6 C& H&lt;%
! |* a4 |: R# @2 P: Q1 n5 coutput="XXXX"
1 J+ Y: ]! ~# [) b$ K9 {Set debugstr = New debuggingConsole
; l9 K: p: \1 _5 ?- F5 Idebugstr.Enabled = true
, G0 M+ L: s1 s( U   debugstr.Print "参数output的值", output
  C6 H* K- n3 [8 r" r. l6 q' B  Y$ Q   '…… . \3 y. [* b6 K$ W
   debugstr.draw / ?6 k6 p  F& q- Q' ~3 m& Q
Set debugstr = Nothing & W6 J9 v1 k' e$ R+ ~; u* X. R
%&gt; </P>
1 Q2 I' A- H6 b0 |<>=================================================== </P>
: |4 U+ J' @7 R8 p! w<>debuggingConsole.asp </P>- k; Y3 G7 l  i: q* T% r" ~! P
<>&lt;%
5 _8 C- Q9 s4 S8 W" N0 ^Class debuggingConsole </P>$ i" U( N' U& B7 U( G2 z+ [3 O
<>   private dbg_Enabled % p& m0 G' Z! L, x- a4 j+ q; E
   private dbg_Show
5 P, N2 u' ~4 h: _4 M% K   private dbg_RequestTime
" P, J9 y& O! x7 y5 Y   private dbg_FinishTime $ U! w6 z' H0 ?8 L" C/ K
   private dbg_Data ! a+ @4 O+ [; B, _. `* k
   private dbg_DB_Data
4 S( T! t& a$ u( u   private dbg_AllVars ' ~4 v/ G; x5 ~2 P6 L8 M- s
   private dbg_Show_default
8 B" f- a# A; A) G3 A; s   private DivSets(2)
# M2 L# j2 w9 v/ z   
. P% q4 X" Z6 C5 |9 F% H3 k* n3 C'Construktor =&gt; set the default values
$ [' b# w5 ]% V0 m+ a/ }3 U6 |Private Sub Class_Initialize() * z: [* i1 h- a2 B' a
   dbg_RequestTime = Now()
; I/ f5 f( A/ x; F  o   dbg_AllVars = false
( v; q0 g0 L( R6 ]# }" F" G   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
# |. F6 `* r4 ^8 W0 i! 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>
. `$ t) K; @/ K2 y<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;+ N' C* a6 y! I$ \. \
&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>
4 \0 L% k0 p+ h6 i9 h: h<>   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>; X+ {# g" _3 N+ G: G: ]
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ( u6 y7 N4 W" ^1 N" t/ e9 X- I
End Sub </P>+ h& F' c9 z  |( S! r
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
1 s# ^( D# W; \* [" W   dbg_Enabled = bNewValue
. o1 e, u: V$ M7 V7 I) QEnd Property </P>5 o# d* S1 X7 X$ v
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
& v. t& {3 j$ Y" n2 C   Enabled = dbg_Enabled
/ J/ @$ p% }7 OEnd Property </P>
) C; ^' A4 i( R; c3 q<>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 . w1 c4 X$ Z  {) d% Q
   dbg_Show = bNewValue
0 d! ]5 j9 m/ G" h9 Q, WEnd Property </P>
# ]' A, \) R( {8 ]5 H, i<>ublic Property Get Show ''[string] Gets the debugging panel.
3 A% }2 k' ?% f9 q# l( @" i   Show = dbg_Show / A! x6 Q% Q* h+ z5 Z* S$ c
End Property </P>
, R, i' W! A: }8 D" x- E9 u8 f& d6 h<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
3 k9 a5 Z3 Z; V; M% [- g7 O   dbg_AllVars = bNewValue 2 a5 W$ e" J  c) i& M6 g) @
End Property </P>
0 c9 y7 E+ w9 d' y, h<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. * t& v9 f8 W' E
   AllVars = dbg_AllVars
) s7 X0 q" Z' P! U1 X5 M9 SEnd Property </P>
- z$ \. L. w. R# b$ n# D<>'*********************************************************** 4 m3 m* d' k0 X4 H
''@SDESCRIPTION: Adds a variable to the debug-informations.
( W7 [3 e. J9 F7 S2 v' B+ s! s''@PARAM:  - label [string]: Description of the variable 8 u, P  W; M! F" T1 S. T: }
''@PARAM:  - output [variable]: The variable itself , f$ a# d& V/ G+ G
'*********************************************************** " l+ \; @: b! D, L7 p3 H
Public Sub Print(label, output)
- n7 _/ F$ j& h# U1 X   If dbg_Enabled Then 5 y( O$ g8 X' ?, i# ]
     if err.number &gt; 0 then . j4 m1 z+ {# O, }
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
7 v$ o0 W# N! N0 D( c       err.Clear
3 y+ Z9 [+ w0 R& i     else
& H3 E, }4 ]' r0 W, h0 m# H       uniqueID = ValidLabel(label) 3 S. U- j% z! ]& |% @
       response.write uniqueID - r0 x" \( U3 _6 p
       call dbg_Data.Add(uniqueID, output)
) k+ z. N; _+ {, B' D/ W3 u! E8 D     end if
  z- g" j, e! Z7 _8 F+ X   End If ' j* m( V* G1 b* y+ G% k
End Sub
: J) C; V( D/ ]6 R1 j" K, A+ z  
' \6 a% _- }' [, A8 g2 c% U! x'***********************************************************
' P) m* W9 n, c* ?$ C'* ValidLabel
) F2 H& e  `5 t/ [# }. T'*********************************************************** ) [4 r2 i: |, M3 Q5 ?+ \
Private Function ValidLabel(byval label) + `: o: f# G- i$ F+ l' \
   dim i, lbl ; `% m" Z* I, x# @
   i = 0 ; [% @( d1 H* o5 H3 s. Q
   lbl = label 1 n! _! L) l2 o  t6 |4 h
   do   Y; v- u! j1 N1 z
   if not dbg_Data.Exists(lbl) then exit do
, Z  p2 d! p& o4 i- S   i = i + 1 1 Z0 `0 @8 x2 @
   lbl = label &amp; "(" &amp; i &amp; ")"
9 N& m+ H& b4 [  f9 E* D$ Q* c  W   loop until i = i 6 E' c5 F- W1 o6 P( {
  . F& J! y# g# R) P
   ValidLabel = lbl 9 ~* W: z1 w$ u$ T
End Function
5 C5 p; N. W3 o' o2 Q7 |  6 v0 ~  _3 R6 M! b6 k( ?0 f! p
'*********************************************************** * j+ V. [, h5 M; l
'* PrintCookiesInfo 3 m: l" p) G2 [- F7 q) Z+ a8 d
'***********************************************************
% I9 D; i5 a+ E5 s2 ?! B( K3 GPrivate Sub PrintCookiesInfo(byval DivSetNo)
7 ]7 r/ a$ Z! `# ?0 F% G8 @   dim tbl, cookie, key, tmp
! s+ H3 [$ h1 l- O" }8 c  D1 S5 J) \   For Each cookie in Request.Cookies 4 k7 ^- |! V- R9 P5 U
   If Not Request.Cookies(cookie).HasKeys Then
8 O+ I. f* ~" Y8 z3 z9 _" ^  M( e% m     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
" P% X5 K/ k# D1 X& n. ?   Else
8 I) |) ?, i! [& a7 x6 m9 O     For Each key in Request.Cookies(cookie) 1 j- R! P+ h" p+ c- X2 s
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
  S, W3 V: ]" p/ E7 ^/ lCookies(cookie)(key))   : ]( n3 `# h% i- L" E0 l4 d. {9 Z
   Next 2 }. [: }- a: X/ d. _% L3 ^
   End If
/ B& }% u1 q, }9 s2 M   Next </P>: c' _& ?  i- a% u$ _
<>   tbl = MakeTable(tbl)
2 a" M2 x, j& J4 C   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ! ?" n/ e/ T+ I* X" ]$ ^
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
4 x4 O% [% y- o' x2 E; k1 c   Response.Write replace(tmp,"|", vbcrlf) . p1 b) x/ s/ I
end sub & A9 {" k' b4 x+ P6 P
  1 t1 ~8 T; J( k0 V, {, b" G2 h
'***********************************************************
0 a; A) N& X$ S2 O2 \0 J5 ^+ s'* PrintSummaryInfo
( E9 \2 Y) f3 ]'*********************************************************** 2 i& ^' z. \* t% X$ f
Private Sub PrintSummaryInfo(byval DivSetNo) , D) s: k, h' l! A1 h, S2 W  x
   dim tmp, tbl
0 y$ [& [) _2 m& R% i, G# H   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 8 R8 E) F/ V- F
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
) U' I: m- `! _; _   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 7 Z! L/ D& t0 _$ S* w2 d% v
   tbl = AddRow(tbl, "Status Code",Response.Status)
3 l8 g, j8 M# W" \# u   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ! a# f2 R* [, z+ a) A- a8 }
   tbl = MakeTable(tbl)
# N4 U7 s2 c& ]   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) + u. c& {3 h* i- D) k
   Response.Write replace(tmp,"|", vbcrlf)
" C" p, S, X# T* R+ L2 N7 o/ GEnd Sub </P>
1 e4 ~; z( _" w6 [% _" W<>'*********************************************************** 5 B( ^0 Z+ h  D+ f5 ^, K
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& a5 t8 f' T( H6 ]''@PARAM:  - oSQLDB [object]: connection-object   D; R* E; |+ E- v% P, u
'***********************************************************
5 Q# v1 Y' }# W" K3 ?Public Sub GrabDatabaseInfo(byval oSQLDB) ' u8 [9 o. A/ F; {+ ~2 M
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
; ?( @1 l6 E* E& l' U   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) / l+ J! T6 q7 B0 M# h
   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# p* ]' i" _$ l: U   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
; H! {2 r/ C. ]0 ]% Q4 v! nEnd Sub <>'*********************************************************** 3 R) I# R+ ^3 m& ^1 ^3 g! g
'* PrintDatabaseInfo
) c; e$ \) L* q" D'*********************************************************** 8 G7 g! Z3 v% B- l. m
Private Sub PrintDatabaseInfo(byval DivSetNo)   _% o, a% T. {' ?7 [1 p+ D
   dim tbl
# _, `0 q7 t$ f3 ^/ O2 K! ]+ Q   tbl = MakeTable(dbg_DB_Data)
) y  g0 Z! q; r7 z3 }& b   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
' x8 o, ]& _" G   Response.Write replace(tbl,"|", vbcrlf)
: S; p* ~1 C, K7 Y) b! mEnd Sub </P><>'***********************************************************
. G- y6 X( B. v' h, k'* PrintCollection # d0 d5 @! M+ M  j
'***********************************************************
9 _3 i, i" ]7 d" P8 x- CPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& V8 n/ r) q4 p* d   Dim vItem, tbl, Temp 5 n) j) U1 E8 Q7 M: J0 g
   For Each vItem In Collection
5 p7 m+ z1 }' d* h     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then & h% ?$ o- C- K. f1 V: d# w2 ?3 j, a
       tbl = AddRow(tbl, vItem, "{object}")
( T! Z0 k9 @# z     elseif isnull(Collection(vItem)) then ' `# m" Q- u8 ~+ I) s
       tbl = AddRow(tbl, vItem, "{null}")
* O, T$ H" Y& m' N     elseif isarray(Collection(vItem)) then
2 A8 u/ i/ }$ i       tbl = AddRow(tbl, vItem, "{array}")
4 `+ W6 N# M! s) k     else , t$ ?5 S8 s0 u. H1 O
       if dbg_AllVars then   i" B9 ~  z  k4 k9 u
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) & E/ R0 @, q! x/ l' R
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then # l9 k: E3 U5 B. G; w6 R& g
       if Collection(vItem) &lt;&gt; "" then
# g# P# v4 ~0 _6 R' `+ D3 I) E$ G0 |) A: Q       tbl = AddRow(tbl, vItem, server.HTML
! @* {$ ], H# \" K3 Z+ JEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 1 q: w* _. {7 s4 u' i% b
       else
$ b0 B% _( X$ @5 r* ]$ b( y       tbl = AddRow(tbl, vItem, "...")
/ I2 [/ |: M6 \4 Z5 w2 p$ g' j% O) |       end if 7 z- T' g4 d" c+ y2 W
     end if 9 i! B9 U3 u2 ~' g+ q0 m
   end if 6 W' F% f$ ?' z$ `( D3 a
   Next * ?2 q& Y( E+ L, c  ~* R$ [) f6 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 ; h. p7 u. O" V; Z
   tbl = MakeTable(tbl)
6 k. L4 L9 N/ @5 H4 b   if Collection.count &lt;= 0 then DivSetNo =2 9 u( @; r8 p0 E# K
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
; Y! D5 p) N" G- V     tbl = replace(tbl,"#sectname#",replace(Name," ","")) , v- Y- D& c0 k5 B9 ^3 S4 L$ h6 m
     Response.Write replace(tbl,"|", vbcrlf)
; h3 l/ |) N" Y0 B# X4 tEnd Sub
2 O9 Y' ^4 x% b  p  8 B% l& K1 g: t% S- z( ?7 V
'***********************************************************
8 p: m$ O( g" t6 A' u3 J) _1 V8 ['* AddRow
  S! i( G6 i# c/ U3 ~; V'*********************************************************** 5 L( s; n# b! d; f) {
Private Function AddRow(byval t, byval var, byval val)
, G, F' V$ J  m   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" % O1 D0 h) V9 x7 n' C- J& `
   AddRow = t 9 @0 s5 }* S: D9 a$ G, A
End Function </P><>'***********************************************************
8 r8 ?0 ]* L1 ['* MakeTable ) l4 K- r& Z8 q! Y% g6 r' Y3 M" I
'*********************************************************** % v4 B' {- A% e
Private Function MakeTable(byval tdata)
1 h+ ~/ W5 Q$ O$ t# f0 b7 r   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ) @* k. j5 ]6 [4 h- X
   MakeTable = tdata
" u4 {2 N: D- Q1 Y: x; AEnd Function </P><>'*********************************************************** 5 G; {3 F4 }+ w/ n) \1 c8 K0 F( w. T
''@SDESCRIPTION: Draws the Debug-panel
' x( P) N' {+ P'***********************************************************   @2 i0 Q2 H1 G% L
Public Sub draw() / K3 Z6 N$ c  L
   If dbg_Enabled Then
1 F: F; B9 U6 i* T  K" z8 c     dbg_FinishTime = Now()
. }3 b2 U- F- R' L" C; A) Y- n  
' O. e0 Z! p! m/ w, o5 C   Dim DivSet, x " M  Z4 Y, U/ J4 V4 D2 @
   DivSet = split(dbg_Show_default,",")
' u- o' L1 e0 p: [     dbg_Show = split(dbg_Show,",")
0 K6 E, J/ R* @; g$ E& B  
" t0 |; v' B, d; U1 ?: U/ m   For x = 0 to ubound(dbg_Show) * r- n0 q7 f: q. [/ e
     divSet(x) = dbg_Show(x)
& _( E9 [( P+ O) O   Next
2 n! V" q  a0 V  F$ L  " @; H% j( o. v% h4 ^6 S4 w8 Z
   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;"
& J# T+ x, w+ @   Call PrintSummaryInfo(divSet(0))
4 x6 p+ W4 _' i- j; S     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* T9 Y% a1 B, r# s# p7 R9 O    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
1 {$ X) `6 ~9 h9 p3 a8 w    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 B; w, o# B! ?  `  _) k
    Call PrintCookiesInfo(divSet(4))
* i, y1 N* J6 e/ E2 M# k    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))
, _8 N8 L8 o5 A, e2 H    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") % A  ?- [5 w) `. p0 K
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 1 ^/ w9 i# K0 M9 `
    Call PrintDatabaseInfo(divSet(8)) : ], {4 _1 o' G9 K, \( ?
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 t; Y$ ~0 t1 b% m# r* [3 h
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
0 J, @/ n8 Q2 ?  t' C7 ?    Response.Write "&lt;/Table&gt;"
# V* ?, Q* s; D4 v% c1 q. l8 c" f   End If
7 q9 |/ m( \+ Z& Y, s, K; D, o9 tEnd Sub </P><>'Destructor - Q4 M% V) g* k7 t2 F, P
Private Sub Class_Terminate()
5 M/ U- q) i, F; \& j  o5 N; R   Set dbg_Data = Nothing ; x1 N) h7 m0 y0 l3 {1 y( B
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
& [; f8 e1 p5 C$ n0 j5 W5 C' RCLASS debuggingConsole ) b' P$ |0 S& S
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false / w5 X9 z) y% z# z6 J, _
&amp;n
) F& _0 c# V3 Cbsp;
) p7 o; q0 y5 _) s9 NProperty Get Enabled===[bool] Gets the "enabled" value 0 ~; \9 K! z4 p0 a4 ~1 ^2 I5 b
  8 i3 v6 X9 `. s" \* a% m- l7 }) b
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
# B0 |7 Q; ~8 a+ @' J  / c" R2 X" F; C  T3 V( H3 G
Property Get Show===[string] Gets the debugging panel.
$ V6 \4 F$ q* ~( B0 M+ J  
0 |: o+ H6 k# f- {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><>--------------------------------------------------------------------------------
) K8 M3 X; P2 g  b& m% @Public Methods </P><>public sub===Print (label, output)   `# |4 c* [( x  s( Q# z  a0 J
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
# o2 v7 ~3 x7 p5 }, Q9 k6 I   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
8 x; z' f" E/ y# c   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
9 b. |9 Y% G* \5 n, wMethods Detail
/ G# v4 Z/ l; v  
, [" s6 }5 Z9 Z  q# v6 \# u  apublic sub===Print (label, output)
4 k1 e, i  W9 PParameters:  
5 v& @9 p8 J8 h) n, u- c3 A- @' M   - label [string]: Description of the variable
" q1 C" H) I# @7 T2 x   - output [variable]: The variable itself
) m+ P, ?6 W% w" p  M" ^: j  3 F' H4 q$ g4 h: Q
public sub===GrabDatabaseInfo (byval oSQLDB) : b, a! Z& y# P  f$ y, Q$ @
Parameters:  - v- B. g& s( O$ k% r4 G
   - 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-5-31 00:21 , Processed in 0.427569 second(s), 57 queries .

回顶部