QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
# M. k1 Z( W, n* u2 |9 X1 Y3 j<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
! P  I* w" M: S7 |使用方法很简单: ' i7 N$ [0 {& X: y8 v8 s% v. ?; {6 [8 ~
test.asp </P>
6 }4 g( n% y5 F5 g/ a% E<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
) m2 B. n1 m" q+ B: a* @8 T) y&lt;% ; y* T8 h. a! \7 c1 F
output="XXXX"
$ ]2 F+ V7 T% R3 J& eSet debugstr = New debuggingConsole 3 a0 F# p$ W& X4 j$ a1 {2 V; Q, W+ m" y
debugstr.Enabled = true
$ ?4 `; @! n  A2 I' l- ~   debugstr.Print "参数output的值", output - z& K6 W( T7 j, O+ `  Y: q4 c
   '……
. v* B0 B9 ~' }4 p   debugstr.draw 7 A; P, M5 y8 Q6 t
Set debugstr = Nothing
( Q; z- b3 @. l& l, G6 }: H%&gt; </P>1 O  S6 v% a/ e: m
<>=================================================== </P>; x) |% K1 \& X0 ?- d9 R2 j
<>debuggingConsole.asp </P>
& x8 H5 a; j% d0 x<>&lt;% ' i7 ^6 G3 z! R2 b3 J) {1 h3 V
Class debuggingConsole </P>* Q( e/ t8 z% {% o; r6 [+ z
<>   private dbg_Enabled
& c) a# P. R9 D( m/ G6 o# k" B   private dbg_Show # x. J) P2 i$ l' {/ D
   private dbg_RequestTime - d6 C+ R* u! P* _+ s
   private dbg_FinishTime
% K& t. Z5 T. ~  B   private dbg_Data - M) t& z) Z% B$ l6 d4 I0 M
   private dbg_DB_Data 6 W  i0 v% c1 A6 V+ W
   private dbg_AllVars
! k- U( j/ [5 F" Z   private dbg_Show_default   \0 Z- ~6 m+ E2 O+ ^) G
   private DivSets(2) 9 L+ b' @0 x$ H6 F5 T0 g
   ' N4 l$ X- b5 l+ B. i4 s. o1 J' ?
'Construktor =&gt; set the default values
( n. U% u$ _( d0 {6 `/ o) APrivate Sub Class_Initialize() " B9 B. n2 Z; M$ }& l; n; ]& I
   dbg_RequestTime = Now()
0 h9 D4 }7 K/ S" V* V% [0 H8 U. R   dbg_AllVars = false
$ X9 K+ B( b4 @2 p   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
! o, ?. r9 n$ j. A0 m1 ?<>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>
, j) o! ~3 h' L<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;  T; d6 c& Y3 l) G# u
&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>  u% a0 b6 H" 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>
& k- p# v3 A& e5 N, g$ N. _<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
  Z4 S6 f) n- j7 PEnd Sub </P>
% |# N8 h- x% P* t" P) G" X<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
# r6 I" m4 M7 R$ m   dbg_Enabled = bNewValue
' f6 s' `# _$ @7 dEnd Property </P>
& E$ a9 d* `5 M9 [2 E<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
! o/ t1 Q7 h  j4 _- U   Enabled = dbg_Enabled ( g, A  S5 `& }/ E# M
End Property </P>
  r: U/ ^( a, P' ?+ 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
$ c0 _3 C  B. |3 L, r   dbg_Show = bNewValue
$ ^* j: b2 s4 K. I4 P0 a0 [End Property </P>
% h( C+ z/ |+ a" Q, |<>ublic Property Get Show ''[string] Gets the debugging panel. - B  ~7 D( v' u2 D9 K- G
   Show = dbg_Show 0 o, b) N% ~7 ~* b7 Y' T
End Property </P>6 A5 q% j) _* I* b) U: _1 u0 n0 l& v
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
2 l7 x$ T% K2 k7 m& G   dbg_AllVars = bNewValue ; n+ ?8 I; \/ w9 e
End Property </P>
& K: w' r2 V6 ?<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 1 n. i! @8 R; [0 S
   AllVars = dbg_AllVars 4 v3 F5 P% }% E( K" z3 D
End Property </P>
. ~9 g1 e2 h% D3 G<>'***********************************************************
: o3 D$ G  h2 y! v: a1 L2 y/ C2 h''@SDESCRIPTION: Adds a variable to the debug-informations. 5 f+ e. j: @8 |8 r( z: m5 X& t
''@PARAM:  - label [string]: Description of the variable ; u; u: x6 v3 ]: f
''@PARAM:  - output [variable]: The variable itself 7 W3 K3 n2 h. v- I8 d9 T
'*********************************************************** 2 B8 p3 w* ?+ u: |. ?
Public Sub Print(label, output)
2 ^3 L# l- a- ?/ L9 i3 X& V; E$ ?   If dbg_Enabled Then
% ]9 s0 O2 B# G4 a% S# x$ u5 ?     if err.number &gt; 0 then
$ \1 n# y+ M) U! J5 b4 }       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
3 ^  Q, |, a  w. x2 a       err.Clear / p% W. F1 T) g
     else / k. D: J; S5 H& p
       uniqueID = ValidLabel(label) $ |3 c* B' H2 s! m: a$ I6 T: E
       response.write uniqueID & d" {/ `% k; p& i1 I$ p
       call dbg_Data.Add(uniqueID, output) 2 w+ u9 P, R( Z& s  I" ]
     end if & v4 E( I- I2 p5 q" T
   End If
! A8 E, c3 m3 c! t0 A* Z# T; rEnd Sub
$ i8 p, c: F( {) `$ @  ' n5 @# W, N  ?) p: a
'***********************************************************
# i: ]7 A. V* f' H2 ['* ValidLabel # q! U; X, Z- K$ S
'***********************************************************
1 i2 M- Y! _2 c& APrivate Function ValidLabel(byval label)
4 `& z) w3 B; v. _  {* s   dim i, lbl 8 n+ j8 f: k, W
   i = 0
0 Y# O+ P# P* A   lbl = label # x% D; z3 b. Y% D2 [) s' y, Q4 h
   do
" J1 P! n# B  W, p   if not dbg_Data.Exists(lbl) then exit do
$ z/ _: t/ p( d0 {   i = i + 1
1 _. u% k) o% q1 W1 I  y2 a* S   lbl = label &amp; "(" &amp; i &amp; ")"
5 n3 v. H5 E7 H  ~4 U. A7 k   loop until i = i
' P" u& o# q# l3 K) Y  
% v) ~- Y$ k8 }  i   ValidLabel = lbl . d  U* P4 q/ |
End Function
/ q- Q: [3 l! x: Q  2 \6 L7 P. i$ f
'*********************************************************** * {- h5 A9 {$ Z; ^% }
'* PrintCookiesInfo
1 g! y9 O5 w% n8 R3 A& t! ?! P'*********************************************************** 5 P  u3 n8 l8 u' Y
Private Sub PrintCookiesInfo(byval DivSetNo)
8 |. C, O+ D( p0 {& ~   dim tbl, cookie, key, tmp
0 B/ f- }  ?" C: ?6 B' c" I   For Each cookie in Request.Cookies
% n1 u  P+ k7 i5 a% P0 ^& e: y   If Not Request.Cookies(cookie).HasKeys Then
# O6 {1 `/ C+ K' d: \1 g     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   7 x1 s4 k) r1 l& u
   Else
- }5 d- ?/ M  h9 ?     For Each key in Request.Cookies(cookie) 6 O) S2 ?& o: ]- e5 |' |( V
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 0 H. o$ {8 k8 s+ L8 l7 S
Cookies(cookie)(key))   
6 t4 G: c8 ]& j" r: e  @) y. a, J   Next
: Y' G% _* b: p: S   End If ; _2 l( K3 f; ^- o2 K: k  v- {' w7 a
   Next </P>
$ b, Y4 {5 G6 ?7 H+ r<>   tbl = MakeTable(tbl) - M2 {# c: m2 J& e% S
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
5 ]- y& e3 l( {: d$ f/ K   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) . C5 x; R" ~! [" N: i  Y+ T
   Response.Write replace(tmp,"|", vbcrlf) ) \) D) {7 r( b& D+ _) V; t
end sub
4 ~3 F! B2 l/ K4 u" K  - n3 ]3 E0 p. A* v% F/ M1 P
'***********************************************************
1 E, \, z; I; h* r3 Y& |7 ^( j'* PrintSummaryInfo % a0 K- q, }  ^: p3 }
'*********************************************************** " {* U& U9 T( g0 d! c: O2 A# x7 T
Private Sub PrintSummaryInfo(byval DivSetNo)
: c& B& B% G. C2 z2 R& \% L   dim tmp, tbl 2 R% v5 J/ L' L+ a: {' m
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - _- v% p( ]2 w
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
/ ~) o' V" _% {. X   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 M# l+ I% |3 g8 x" b# q   tbl = AddRow(tbl, "Status Code",Response.Status)
, a* E* B. f  D+ W; `   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
5 x. B: t6 X8 n- i0 K   tbl = MakeTable(tbl) 0 O# `1 }3 d' R  ~
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
/ x5 O4 _- ~/ P: Q/ L   Response.Write replace(tmp,"|", vbcrlf)
$ D  `) r5 f6 ~% {+ P4 |End Sub </P>
- L9 t  b, W2 i4 ]7 ?8 m1 l+ e0 |<>'***********************************************************
# A5 T9 l: h1 \4 B& z. `$ e''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& b, O; e- Y) Z5 O''@PARAM:  - oSQLDB [object]: connection-object
) q  S% e3 B; Q- H'***********************************************************
9 Z0 y. s0 O& J$ Z' Q  S& }( HPublic Sub GrabDatabaseInfo(byval oSQLDB)
0 X2 S0 i  y1 R" [   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
  w& p" g" p9 Z1 ?) a' u6 B   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) : ^5 ^2 d, z3 E1 d6 |) g/ W, v. j. e
   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"))
" J2 j- t! x% `3 N" k8 L/ Q! \   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ! h6 c. E1 a+ {' \' g& J
End Sub <>'***********************************************************
2 @6 Z1 B2 c3 j4 c! o'* PrintDatabaseInfo ! E  }, i; R4 o1 e: r) l( F4 E8 R
'*********************************************************** 1 G4 t+ f% |7 k# L
Private Sub PrintDatabaseInfo(byval DivSetNo)
* Y! j! d0 }8 ]. C" f   dim tbl
( d2 N( P8 u) ~7 o% h+ g) E0 K   tbl = MakeTable(dbg_DB_Data) ) U% Z9 z3 {' R" m2 ]9 y3 r' g" `
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 1 t3 @1 B% q  t9 G1 v
   Response.Write replace(tbl,"|", vbcrlf) 9 q" M: i' O, j; }- g
End Sub </P><>'*********************************************************** ! m" j+ A0 d9 S" B6 i
'* PrintCollection : X) c: F% s5 k  N# P3 N8 W4 g; f
'*********************************************************** . h! [1 K. Z' V2 J
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 7 c2 ?$ r  V3 {5 U% z5 a4 y4 F. U
   Dim vItem, tbl, Temp 1 T$ i7 O- Z) M9 q: e
   For Each vItem In Collection 4 D+ ?$ Y) l$ s" T: q
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then , _: ?/ L7 g/ n% L: W4 [$ C
       tbl = AddRow(tbl, vItem, "{object}") + u4 K2 m$ T# y9 w8 n  Y8 o
     elseif isnull(Collection(vItem)) then
6 k, _' J$ {' A" |       tbl = AddRow(tbl, vItem, "{null}") " M, B1 A  H! s) P# z/ u
     elseif isarray(Collection(vItem)) then
% L- X% L4 d- a+ I       tbl = AddRow(tbl, vItem, "{array}")
" A/ k2 l3 `: w1 H     else $ Y# R9 W" N0 A4 }$ E: i3 V9 e
       if dbg_AllVars then & Q, w. h. w. X& T, M
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
8 I: H3 @' q& @# K) J     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
0 w% K0 e8 K7 R9 p! N1 H; u* A       if Collection(vItem) &lt;&gt; "" then
' M0 D* G/ }; }' @9 b       tbl = AddRow(tbl, vItem, server.HTML5 G/ X4 g& \  r* @' |
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
; S2 W( h) ?8 e3 y6 p, V       else
' ^9 R5 i5 i% {1 t. W& c4 c9 r: O       tbl = AddRow(tbl, vItem, "...")
# j5 ~5 ?" D8 B& u" ]" U8 y! T3 q       end if
1 g6 t+ z5 ?! p( c- a6 H/ n5 p% \2 H     end if ! y, J; S* u3 z4 f) x7 U
   end if
- w/ i8 E3 z8 c5 ~% S  u/ F   Next & Q1 B; M7 }# g
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ) x. P2 x5 ~& X" P4 a" c0 L
   tbl = MakeTable(tbl) 9 f; c% ~  o& i9 \: q+ U8 e! G( h
   if Collection.count &lt;= 0 then DivSetNo =2 , V( P9 F# d9 C4 L* W
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 a8 u8 ^. K9 `     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* b/ N1 H: O( [! |     Response.Write replace(tbl,"|", vbcrlf)
5 l3 n& F5 c- j) m' y) ZEnd Sub
0 Z: ]7 d" i0 e" e/ q1 N  & S9 r- o! g/ G
'***********************************************************
9 T: v( K7 T  q2 x; X'* AddRow
4 D- U3 }* Y6 L+ f4 [% x7 x'*********************************************************** 6 Q* \7 ^+ B/ h; n; Q% \
Private Function AddRow(byval t, byval var, byval val) / y0 U6 f5 }) ]+ n$ X
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
9 @8 B; i; G% o" u2 X( x   AddRow = t
  H% ]: q& W% }End Function </P><>'***********************************************************
/ d0 `. S  j8 y) p1 K; H7 s# r'* MakeTable 8 u; \" v# W# J7 G1 V! b, h3 |) j
'*********************************************************** 1 K& Q4 p1 k4 p7 l' X% Q" r
Private Function MakeTable(byval tdata) , P/ W* i  v' J: F/ X
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 5 |# l# v& X* Z% O
   MakeTable = tdata 1 h0 }+ H& S6 f$ w
End Function </P><>'*********************************************************** , m' Q3 S8 P$ R9 b9 r: F" d) h
''@SDESCRIPTION: Draws the Debug-panel 9 B' |8 h. G" X$ w
'***********************************************************
- |% |3 _& G8 ?8 m& o) {+ JPublic Sub draw()
8 i: X; |# Q$ F$ H   If dbg_Enabled Then
' B) m: d3 O- l     dbg_FinishTime = Now()
) z, x3 ]- G. R2 j9 ?# b4 i  5 ~5 }3 h. W- i2 D3 n0 U) w
   Dim DivSet, x
; _; L1 V! I9 k' m* F3 H( O   DivSet = split(dbg_Show_default,",")
0 w# [/ Z9 ?: u) J! U7 G     dbg_Show = split(dbg_Show,",") $ P7 U/ b8 D# Y- `9 ^
  
0 i- X7 G9 T! f$ i8 i   For x = 0 to ubound(dbg_Show)
; p7 i6 z6 ]7 d& F; m# \# M     divSet(x) = dbg_Show(x)
/ [9 Y( f8 P" K% l4 V   Next ' q, B" y0 R7 S* S- L
  
4 }4 ]) Z- M) U   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;"
# m$ W- R! {6 {8 u: V   Call PrintSummaryInfo(divSet(0)) 1 C3 B& j. J0 O4 ~3 E$ R* c1 ]
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
5 ^  {. ]# C" e+ g  i2 B3 a    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- r6 W1 {1 K* Q    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 t3 X! A2 r! N, ]0 [! X, ^    Call PrintCookiesInfo(divSet(4)) 5 j2 ?: D2 J. R9 r( f. ]) }% R
    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))
/ x% }, n5 \  X0 p5 k    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
1 ^" @, `3 N7 |' C    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) / u0 j7 w* W! ?% P( t9 Z# G: G
    Call PrintDatabaseInfo(divSet(8)) : Z# |/ f- R, p( s/ K
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 3 O: x' z; d# J8 p; O! H
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") * e' M# d+ ]1 v: H' @
    Response.Write "&lt;/Table&gt;" 8 Q& D5 a/ Z5 ?- C7 z+ h8 \% |. y+ k" t
   End If 4 S; t4 C& _- E  z1 ]# E% r- I7 u' u- H
End Sub </P><>'Destructor
2 ]) M6 _- A* O8 {Private Sub Class_Terminate() ' A7 x; K& H( b6 ^
   Set dbg_Data = Nothing 7 T% g% G( E, K9 ^' u
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
) x* J/ C+ Z$ Z- V" @9 j1 H1 gCLASS debuggingConsole
. z: m0 {: u) v. m3 UVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 2 P$ o' G" G- O2 `3 _' q& X
&amp;n
( {0 X! Z7 M1 H2 ^* Tbsp;
2 o7 g) Q3 j* w& H7 k4 Z! w* RProperty Get Enabled===[bool] Gets the "enabled" value 4 H9 {; l  C: B( B4 n4 e1 v* k8 e
  ; c5 c3 Z6 v; {' I( H* k& s
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 A  ~, i$ C7 {$ @
  2 B4 f- N: A2 l9 S0 E
Property Get Show===[string] Gets the debugging panel.
7 u, Z6 x- w9 I7 K& u; D7 Z2 u  ) Q% t8 |3 W; O5 _2 v- T# k: w
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><>--------------------------------------------------------------------------------
- A, v! I* a( U' j- O+ `Public Methods </P><>public sub===Print (label, output) ) a. q& G* x5 x! Y
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 7 i8 v0 Z8 W  ]3 }3 _6 z
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
' o9 \" X2 y% ~7 M4 C. K/ b   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
4 R7 O. E/ ]  QMethods Detail , F0 t' k& N* \! z! b* W
  
& _- F9 L3 p; ]7 _public sub===Print (label, output) 4 z: a2 b; U9 q2 R6 N, e
Parameters:  ; n5 O7 \4 o  p( j
   - label [string]: Description of the variable
. O, [! ?1 y) A8 S# T+ ^: R  {   - output [variable]: The variable itself - b' p8 W2 q% `. d' V
  
- J7 g% S5 x  w; v! k, S. l$ Wpublic sub===GrabDatabaseInfo (byval oSQLDB)
9 [( z4 C% f& r  hParameters:  
  g. Z4 O7 P- a, Q   - 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-12-13 06:37 , Processed in 1.398675 second(s), 57 queries .

回顶部