QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
1 R* T$ m  y% U# n* D<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ) F2 ]: r' x* c  P
使用方法很简单:
4 K- n& {. k; F/ R1 u2 ^test.asp </P>1 X2 a0 Q7 p" H  s0 U" E
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 2 M% h. P0 b& l. U, Y
&lt;% 1 u5 u2 j) l) ?$ R
output="XXXX"
; v: O5 q- \) WSet debugstr = New debuggingConsole
* y) k2 d  B) E1 zdebugstr.Enabled = true
# _1 Q" @  w9 R5 Z- k   debugstr.Print "参数output的值", output 7 j5 c- {# t, C
   '……
, a3 c. ^% C$ s- s/ J$ o7 Z3 A   debugstr.draw , q/ W! ~5 W+ u. }5 O. r9 m
Set debugstr = Nothing " y# Y+ r/ f  X) L$ R
%&gt; </P>8 Q) A: k! l. U6 Q! M2 ~; r, W% Z
<>=================================================== </P>
2 i% i- a6 P, V% q<>debuggingConsole.asp </P>  a$ C& S# d, A- S
<>&lt;%
. d$ I$ C, A" D/ T6 V; nClass debuggingConsole </P>/ l4 h0 I; u! x  v  O6 h
<>   private dbg_Enabled 1 `9 T2 l1 L( i
   private dbg_Show
( k  [5 l8 \6 x! w   private dbg_RequestTime " }4 i/ F8 U- @% I
   private dbg_FinishTime
8 E7 S/ C4 }  @   private dbg_Data . s$ d/ C( ]3 X1 t7 q5 d' M
   private dbg_DB_Data
+ R8 N' ^% I8 }9 K% B   private dbg_AllVars
8 Q2 `8 k( ?/ L; [7 z8 J6 w# H   private dbg_Show_default - M9 z: F1 ?) \6 ?- j+ I* y% g( \
   private DivSets(2) $ i3 E! {) n9 M: m& e
   
- o0 A& ]3 v2 A* Q% _  }- }'Construktor =&gt; set the default values . H5 \% e1 p4 t3 p
Private Sub Class_Initialize()
$ v1 L- f9 a2 }+ p1 O+ T" z   dbg_RequestTime = Now() * X+ h0 y, ]7 ^1 C; J
   dbg_AllVars = false
7 o3 `* M: i$ q( p' C& I1 {6 z   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>) A/ q3 O4 Z5 Q  K' K1 q
<>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>8 C4 G0 r9 W6 H# n
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;. k: g  ~3 s& q0 a! `' 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>+ W8 z4 a0 ^4 |/ }  K# X
<>   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>3 ~( l' z: A2 Y; l
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
& Q+ b- v! @. C7 l1 DEnd Sub </P>
8 C8 K; f* f- i6 M+ n7 y* T<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
1 b" S4 y4 b! W   dbg_Enabled = bNewValue
' X7 @* k# ]1 c$ hEnd Property </P>$ V7 h/ x# N! b' k
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
. L1 ^6 r' y  G0 R* o/ u. V5 v' k   Enabled = dbg_Enabled
; a( T8 w$ f' [& k  EEnd Property </P>1 m% x5 w1 x- z/ L
<>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 g" I; C3 U( f7 u" ?1 t2 j% x
   dbg_Show = bNewValue
# ~$ P) e3 O* X; D5 i; [End Property </P>7 c) R5 g, i( V1 @! y# l
<>ublic Property Get Show ''[string] Gets the debugging panel.
. D2 ?# p* ]! n: D   Show = dbg_Show
2 L0 k8 K' h/ J3 K% j' U7 VEnd Property </P>
/ {7 ~. c9 s; X# D2 z<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false + m" a& }" ?5 c
   dbg_AllVars = bNewValue 7 ^! ~: J# a) j7 {! f
End Property </P>
8 c5 |5 U6 t3 @4 P) _% V<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. / q# k; W9 M: P1 {) I7 a; r0 F
   AllVars = dbg_AllVars
' n9 V( y/ p: E+ mEnd Property </P>/ e7 D& W8 f: g/ R( X/ M5 W4 j/ _
<>'***********************************************************
: w: \/ o; J$ y) m- @1 Y* ?. W& r''@SDESCRIPTION: Adds a variable to the debug-informations.
; `- ?- B6 n" ^  n''@PARAM:  - label [string]: Description of the variable
0 X) N! R8 E  b''@PARAM:  - output [variable]: The variable itself
+ V0 u8 p" I+ z4 ^'***********************************************************
+ v! U4 _: {' f  ZPublic Sub Print(label, output)
% X0 k1 q. a7 ~; m% r% ^1 P* W   If dbg_Enabled Then ( c9 A% F( |0 U* u7 U* G
     if err.number &gt; 0 then
3 I- _  l& k5 R9 d* i       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 5 g0 m3 x( y( V; P2 T
       err.Clear
# [/ H# |' T* }" q& G6 o     else + _+ N% S  [" v* v3 |$ C; y% e
       uniqueID = ValidLabel(label) / s6 m% z! S; E& `9 }
       response.write uniqueID . H  t9 ]2 V5 t7 _% I% k
       call dbg_Data.Add(uniqueID, output) % x- g) W! Z3 v' S1 t7 Q0 F2 c) ?
     end if
1 T- l; {# V1 F: {7 |   End If 0 H3 L( `! E5 d
End Sub
' x) ~9 a" |# U: W( H7 q0 j  
5 f% X6 b- ^8 n'***********************************************************
# ?* ?2 b$ g+ |'* ValidLabel
- _  e& X9 ]* X) p'*********************************************************** * O/ ], q/ L1 s- i
Private Function ValidLabel(byval label)
; y' |! O7 f8 e( D2 O   dim i, lbl # B3 c/ i% @6 e2 \+ ?$ e; e
   i = 0
$ X9 y5 f% `4 ^$ e3 c, [6 H' |  V   lbl = label # l) h; |& C5 `, [" ^7 Q
   do ) T3 H. m' x; o8 S/ i- y
   if not dbg_Data.Exists(lbl) then exit do
7 t+ ]+ Y5 g% B4 A3 w! F   i = i + 1 . e/ Q2 O  a! L, M: O# Q
   lbl = label &amp; "(" &amp; i &amp; ")"
& ]' z0 z: ~6 T' n* t   loop until i = i 9 H9 H$ p4 l5 [7 \5 K. C+ ]
  
( m  |9 K* p5 r" ^   ValidLabel = lbl 5 j1 W! ~9 H# k4 u: U& D
End Function
3 v' C# x$ u1 @4 w3 f1 D: M) Z  
4 M5 p0 }) Q7 F$ o" J8 c'*********************************************************** & e5 ~7 v6 y9 B: T+ i
'* PrintCookiesInfo
. e# K- o1 F9 K'***********************************************************   c% n; Z4 s& f4 h
Private Sub PrintCookiesInfo(byval DivSetNo) 0 a3 i" R% k6 \- b' E
   dim tbl, cookie, key, tmp
$ u& P* o6 V/ @, m) k  U) b$ w& }   For Each cookie in Request.Cookies * k5 f0 f* ~$ u. j2 a
   If Not Request.Cookies(cookie).HasKeys Then 8 j2 L6 \4 |+ s! y# W
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
6 ^) S, q# |: H( E. X   Else
* f' j1 z2 ~1 v* s, a/ W     For Each key in Request.Cookies(cookie) + m( ?, [+ E" P- R
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
, P! i7 F0 Y. X9 Y: vCookies(cookie)(key))   
% ]! p, k# [: H5 D: s( O$ _, A3 `, g   Next / @+ D1 I5 t$ x  ]
   End If
/ b# b& ^: q* ?! [2 `" a3 a   Next </P>2 p* N$ ~3 _0 M8 Z8 }8 }" A
<>   tbl = MakeTable(tbl)
. Y1 B, l: c1 i/ n   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
- Y. M8 t; L9 G  l   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
: ^9 E7 R. i, W5 i  I" h+ Y   Response.Write replace(tmp,"|", vbcrlf) / z" {: c1 s( S4 j* C0 z8 d6 n6 J
end sub : H' i8 A5 I& G; @# A9 A" e
  7 @# E; n- i7 O& M
'***********************************************************
) f9 a& N+ s1 `* r5 y; T/ k6 g$ R# R'* PrintSummaryInfo
, X0 n0 I+ b, T) h9 [: K2 w, ]'***********************************************************   ~; u1 _/ b, A/ I( h: t+ i( S
Private Sub PrintSummaryInfo(byval DivSetNo)
/ z3 ]% T2 d; C  E  y/ M   dim tmp, tbl   C4 ~) k; P" c0 B7 L0 O4 M. ?" k
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
4 t2 L- l/ n3 O1 f  W   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") # t( [) W2 \3 O
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) / `2 V! e2 T. `- I0 q' d
   tbl = AddRow(tbl, "Status Code",Response.Status)
- G1 t) m8 a/ F& P' [! U$ \% k   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ; C- p* C. e; k5 w7 O
   tbl = MakeTable(tbl)   [* p# l4 B/ F2 ?7 e# E
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) $ t4 Z1 `! j; Q# a$ {
   Response.Write replace(tmp,"|", vbcrlf) 2 n; I. q) ^2 Y$ k& p
End Sub </P>
, \1 M8 d- Z( T1 U; S5 Z+ Y<>'***********************************************************
0 B& ^; U2 \. d0 [''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information : q8 S4 x% }8 g( b8 s7 s; ]
''@PARAM:  - oSQLDB [object]: connection-object 9 O8 \1 C6 a6 R6 U$ P
'*********************************************************** 3 T. o2 ?# y2 b2 L7 I+ U6 X+ K# B
Public Sub GrabDatabaseInfo(byval oSQLDB) 9 o6 b! g! D# c) {$ [4 f' D
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
3 ]# K3 t& ?+ L7 r5 G   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
* W' g/ I1 v: n" m   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")) 5 R" {( }' @/ I# r% [& C& T( y, w
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
/ \4 ]6 F9 Y6 u. CEnd Sub <>'***********************************************************
& S4 @1 Y0 p( g'* PrintDatabaseInfo
2 Y9 `: R# e3 g, S5 u8 f'*********************************************************** 5 w% I3 N) S: V6 g$ K# f8 F. u
Private Sub PrintDatabaseInfo(byval DivSetNo)
, g7 O1 j4 R, [   dim tbl : u5 f+ x3 d+ g7 E
   tbl = MakeTable(dbg_DB_Data)
8 S- P, G& ?6 L+ h3 _3 l   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
- v- K+ c6 X( C; A8 {6 Z( f   Response.Write replace(tbl,"|", vbcrlf)
% R1 \: O! L& ~* S* Y) ]  MEnd Sub </P><>'*********************************************************** 3 ]% j4 ^9 B2 |9 D4 l( `
'* PrintCollection 9 Z9 Q  s7 l7 L1 V; G. Y3 ]
'***********************************************************
2 X2 G  P$ M/ ]8 [5 p% h( t1 F+ EPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) % c/ ~9 F  ^' n! l' W/ U+ O
   Dim vItem, tbl, Temp
$ {6 |# |2 i: @( b( S: i   For Each vItem In Collection
. D" m4 @* c9 ?! H) y. r     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then $ I% b* A0 C5 |- Z  j
       tbl = AddRow(tbl, vItem, "{object}") % w& Y( f7 _0 M, U3 S
     elseif isnull(Collection(vItem)) then 9 c8 ^3 m: t- Z& |. x( Q0 T7 N4 @
       tbl = AddRow(tbl, vItem, "{null}") + q2 y( x' n; R! `, G+ H, X
     elseif isarray(Collection(vItem)) then ' [; e! x; _6 W5 p  P
       tbl = AddRow(tbl, vItem, "{array}") # l: s6 x) V* [5 R, \8 d& X. ^8 i
     else
# ^% C4 u1 Y( _8 d       if dbg_AllVars then $ X) S' E6 C% j+ B( V3 y, k6 U
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 0 L6 \# V% r5 Z5 ?2 _. }
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 4 Q* M% [/ r' w
       if Collection(vItem) &lt;&gt; "" then
. R6 }$ d* S0 D: O( p) z/ p       tbl = AddRow(tbl, vItem, server.HTML1 M, H0 H9 l3 g! e* m: o( q
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
* Q6 {, v9 G2 Y: m9 ~       else
% X" i1 v% k6 X) h       tbl = AddRow(tbl, vItem, "...") # Q- N7 p& ~# }6 E
       end if
$ D& }# Z. K  D' @9 t" s  ?     end if
( v4 w% Q. I% u! B   end if ! u$ N+ w& L3 [1 ^' i3 ]) d0 ^
   Next
- d8 z1 c; g, P1 \% g% y) e, ]   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo - o4 m6 t9 C6 Q) u
   tbl = MakeTable(tbl)
% y% i/ u. `) @9 C' [9 Y   if Collection.count &lt;= 0 then DivSetNo =2
* _$ E+ r! J& A6 L6 q$ E' w     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
7 {3 S  U: q8 V5 }/ g# z     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 g5 j4 s( G7 d" r
     Response.Write replace(tbl,"|", vbcrlf)
8 @5 g4 N8 Z1 o5 x7 m$ GEnd Sub
6 P- q+ S7 @5 N4 M+ G  
  a- \- \: N5 t2 m  ]' U2 I'*********************************************************** " P4 K. J, U, W% Y3 D# |/ ?7 i9 ]. ]
'* AddRow ' I: ~. G! V& ]# E0 I
'***********************************************************
: g8 K, x' o3 ?4 _, S# cPrivate Function AddRow(byval t, byval var, byval val)
; b$ e, x8 b8 n; N  v$ U   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
5 ~* c4 S, E. Z3 t& Y" b# y, s   AddRow = t
, U1 _# O$ _8 B' \% Z& U0 @End Function </P><>'*********************************************************** 7 a$ g3 t. F+ w2 |  l# Y
'* MakeTable 1 ^! @! M; ]2 b
'*********************************************************** * v3 y* j3 B/ S9 e2 d. y7 z6 l
Private Function MakeTable(byval tdata)
& K2 m% o8 O3 V2 f" D   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
4 |0 I( P( w1 \0 q$ D2 Z  J7 Y   MakeTable = tdata
6 Q+ G7 r$ p9 VEnd Function </P><>'***********************************************************
; I7 n; L7 h" h2 z; h''@SDESCRIPTION: Draws the Debug-panel
& v- v" k& ~. F: m; [7 ^% l! ]'***********************************************************
) _* A8 I; @) [$ J1 H9 _; W* pPublic Sub draw()
9 m( z4 g" h) p4 I- N/ J7 F   If dbg_Enabled Then 6 R, M$ [. n; I: V- B' _0 t
     dbg_FinishTime = Now()
4 U' r  ?/ b- T* G  0 g+ ]( H) j4 ^8 S5 M7 q
   Dim DivSet, x
- @3 e. h* v8 N# _# k   DivSet = split(dbg_Show_default,",") + E/ g+ E5 T! N$ |' g
     dbg_Show = split(dbg_Show,",") ' K! W" v6 `1 ^
  
8 f: }+ c& A2 j$ B5 B   For x = 0 to ubound(dbg_Show)
  |2 g( z: E$ I4 b, \     divSet(x) = dbg_Show(x) : K& k& ^2 u  c2 X
   Next
/ c/ ~4 q- G, J: D4 z  
1 ?3 _2 v3 l: _8 _; L, C! q   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 c6 U8 A+ \6 c
   Call PrintSummaryInfo(divSet(0)) * P) W$ h8 h) J5 ~8 Q
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 P0 `) {( j0 q
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 6 A$ J/ w, J( e# J- I
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 8 f, a* V% p9 v/ V4 y2 Q( @* t' w
    Call PrintCookiesInfo(divSet(4))
9 E4 i1 z; m: f. U4 W! v. h& f1 w' V" u1 g4 \    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)) $ g- f. ?5 N" `
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")   y2 P4 o. M# z  u5 C
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 6 n' N3 E6 R  K- ]( t
    Call PrintDatabaseInfo(divSet(8)) 9 j9 m  ?2 u+ m* Y% ]
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 l2 p4 ], x7 R$ l- w, M; a    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " {7 j- o  Q3 G( a$ J5 j
    Response.Write "&lt;/Table&gt;" 4 h2 m( W5 y, f; {, b' n
   End If $ {4 k1 V$ H( O
End Sub </P><>'Destructor
- e% ~& P# E0 {; x* u5 d; fPrivate Sub Class_Terminate()
2 U* n( y" p2 m# y% A  H% @   Set dbg_Data = Nothing 9 b- z5 A- |' i0 ~- n) n8 z+ t
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
. t0 x- ~6 k' nCLASS debuggingConsole
3 r% _% u# G, e$ Y) I/ GVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false # ^0 B* [) Z) m- Y7 h  m7 \; o
&amp;n
) M  V( [- y1 n8 k8 W/ t1 Zbsp;
  q: u- B7 N' _4 {6 F- eProperty Get Enabled===[bool] Gets the "enabled" value ' W* P4 L$ i% ?* y
  
5 @9 Q* \* V3 p( N1 ~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 f2 Y* I7 O  ' Z6 S7 y1 P' A: v; O
Property Get Show===[string] Gets the debugging panel.
; J; K' p+ Y" f0 ]5 H  7 _) S6 U/ M0 S" f3 L* G
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$ _5 Y- G! {, |
Public Methods </P><>public sub===Print (label, output)
8 Q8 F1 b6 L. _' i$ ~5 X3 Z   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ; n- f; R4 B1 N1 N" ]% [
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () . r& ]" x1 \" c5 V
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
4 N2 j8 F( q0 Q! ~% b' l& O( a; oMethods Detail
7 F. t$ e; j9 Y- G6 Q0 T0 |  
  A4 t9 g; v) I2 Q- hpublic sub===Print (label, output)
1 l8 D) C% t/ _6 e; Q/ f# \Parameters:  ) _' u7 |* Z  Y$ I( c- v
   - label [string]: Description of the variable ; K9 H3 h4 ~& o/ S, |# |; }: j
   - output [variable]: The variable itself 6 ^: g9 H" Q5 {7 X7 ~) V+ r( c
  
% ]6 ]# Y+ H8 s- V( }  hpublic sub===GrabDatabaseInfo (byval oSQLDB)
/ y, _, h8 \$ l8 AParameters:  
2 G, j5 D- L# z2 h$ {) K' u3 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-4-16 06:04 , Processed in 0.426104 second(s), 57 queries .

回顶部