QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
# {$ r/ V$ y  ^8 J5 ]: `<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 8 i7 [% Z8 y% H. {% ~6 x" }5 Q
使用方法很简单:
/ G0 f! _3 E1 Z, _: dtest.asp </P>  M( o2 o# M! \2 a( f
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
9 }2 l' m$ N$ ^/ s&lt;% 9 S3 d) A* D; U2 w* t" q0 a
output="XXXX"
9 k, c/ F1 X0 a6 Q$ xSet debugstr = New debuggingConsole
: ^( Q- p. Q- |debugstr.Enabled = true . X. u# Q# y  h
   debugstr.Print "参数output的值", output & H9 U$ r0 z# v% _( M
   '……
; P+ G- |4 E/ f/ x8 C8 z   debugstr.draw
2 L, C3 a' p, |% @3 mSet debugstr = Nothing ) }3 J# k( `% g* X# L
%&gt; </P>7 k& y) i7 r! z) n6 b; T
<>=================================================== </P>6 L3 j; j; B2 ^2 T: c. y7 @0 ^
<>debuggingConsole.asp </P>
4 C& K+ S8 i& o, k7 F<>&lt;%
% ]! t- O* H$ `; @' P1 y2 XClass debuggingConsole </P>! ~: Z( d  i2 h5 z# f7 p
<>   private dbg_Enabled ) `& Z2 X, b. j  r( H' C
   private dbg_Show 6 j" L3 o+ q3 @3 {
   private dbg_RequestTime ( x' s3 p* U, B$ Y5 k& Z& {
   private dbg_FinishTime
) N& n: F% n& Z- m8 Y* a+ m( A3 S   private dbg_Data 1 t* x# t$ [; y: {# |8 n
   private dbg_DB_Data
; y' v3 \+ l2 Z  i( e% V6 e   private dbg_AllVars
! b! W6 I  f1 s   private dbg_Show_default
* F9 Q* t; u: A   private DivSets(2)
( [7 A4 h4 \' @/ x! ^  z- q4 u   6 e7 k" H- b1 o+ T9 m  A/ t
'Construktor =&gt; set the default values ) ?% V/ h# j4 T& a
Private Sub Class_Initialize()
1 m$ v# l, q) C0 n5 a- ?   dbg_RequestTime = Now() 1 X% o+ P: C' }; J8 Y
   dbg_AllVars = false
& z2 E9 A/ T" o   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P># E, v3 M. D9 J! k3 Y
<>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>
) K( o2 n" W3 B<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;# u! L' W* }! D8 p6 t9 Z' X! S! p
&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>
1 S; @+ R9 A9 q0 y8 Y<>   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>
6 P5 m5 o/ |# x% [8 d<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
* ]' c; Q: u$ PEnd Sub </P>
- t2 m3 W$ n: k0 h7 \% L<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
5 S4 m8 W" z9 ]( l( g   dbg_Enabled = bNewValue / ^+ K1 e/ a; M* m1 c
End Property </P>* S0 ^$ Z9 x& o: p: x1 \
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value . `2 j- _7 l& X( k; P$ D
   Enabled = dbg_Enabled
, ]" x& X  k, }5 A% F$ n: xEnd Property </P>6 }& }8 c; {4 r6 V; }0 a+ `
<>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
* n7 a+ E$ }; I6 o, W' N) i, @   dbg_Show = bNewValue * X) A" N; y% q* C$ c+ K7 S3 ~
End Property </P>: N4 e: I1 x* Z8 R4 ]
<>ublic Property Get Show ''[string] Gets the debugging panel. 0 n$ W" a0 C, s& T/ Y1 U  o4 B& p5 r
   Show = dbg_Show
7 _6 \  N0 e" xEnd Property </P>
2 g+ y. h/ {( m6 c) h* U5 Q<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ! F( [( ]9 X, I2 g! v. |$ h
   dbg_AllVars = bNewValue
# @2 X6 u6 }: t) O: R" e; UEnd Property </P>5 ~# w) c! D4 H# s! ?3 d
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
  X3 R, J% j( U1 t   AllVars = dbg_AllVars + Z; D" K6 e0 U
End Property </P>3 r, R4 j* W$ M, y, x; d
<>'*********************************************************** ) Y; Y5 Q6 p3 K3 w+ [+ y! }
''@SDESCRIPTION: Adds a variable to the debug-informations.
7 ?& G6 W7 T1 S7 L) H# W! f' d''@PARAM:  - label [string]: Description of the variable
( k$ V2 O1 W5 R( f''@PARAM:  - output [variable]: The variable itself ! x) i0 h( Z* T+ l
'***********************************************************
; _) T5 S. U. `Public Sub Print(label, output)   [$ H5 X7 x2 \9 X  T! a; I+ Y
   If dbg_Enabled Then / i9 O$ D' F5 I+ D5 F* Y5 K4 V: \
     if err.number &gt; 0 then , g( Y$ _! ^6 v7 ^/ S4 {) A
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ; |$ B% m5 ]  y4 c% S5 ~0 [
       err.Clear & R6 }" j- N! l. _8 `, P$ A
     else 9 r( n3 y+ a0 |4 [% r
       uniqueID = ValidLabel(label)
' `& g+ c; c3 t, T6 M" p, |0 v& v       response.write uniqueID # t+ N5 K% e' H4 y% a
       call dbg_Data.Add(uniqueID, output)
3 o" _  k% K$ T' i     end if
+ y. t5 U. A; {4 C) K8 U2 |   End If
2 E  l4 {' S# O2 A  |End Sub ! m8 r9 b, x, l" v( ~) S
  & \: Y0 i2 I' F0 j, ~0 w3 ]
'***********************************************************   _1 B; W: c# N1 j  W$ q
'* ValidLabel 1 X& }5 H+ i7 Z5 b* f( j
'***********************************************************
5 C  \0 K# C0 f, oPrivate Function ValidLabel(byval label)
  E7 J+ {1 @  B* p4 S   dim i, lbl
. d7 l! B% E! n  J5 D9 {7 V& R9 }   i = 0
( d, J1 y6 i$ C$ h7 ?2 x   lbl = label & }, v  i* ~2 F3 {
   do ! ]* n- Z# ~' c$ a& @% u7 P1 M
   if not dbg_Data.Exists(lbl) then exit do 0 v" q5 a) r2 g1 L: ~( y4 K2 ^
   i = i + 1
2 B7 n! G5 v$ @) ~$ t5 g3 m   lbl = label &amp; "(" &amp; i &amp; ")"
: t) ~' P. s, I! X   loop until i = i 4 S$ g, a6 ]2 i" k6 W
  
2 R5 Z4 Z: [" h: w   ValidLabel = lbl , J8 D. r2 P) ^3 R- X+ d
End Function - l1 o- j7 \# U1 {* D) n
  
8 S/ ^2 g" O! h9 {% [$ K'*********************************************************** # K2 {9 I+ _% X6 C3 q% h5 W
'* PrintCookiesInfo
; r' u$ U$ T8 K# w2 \' r'*********************************************************** ( G: d0 ~6 `6 P. Z/ k( Z' u  m3 O7 N
Private Sub PrintCookiesInfo(byval DivSetNo)
3 B6 N. r; K( w   dim tbl, cookie, key, tmp - v/ h: L/ @) {( e7 u* o
   For Each cookie in Request.Cookies
, \" H; ?7 E1 z! o   If Not Request.Cookies(cookie).HasKeys Then 9 m6 @0 L; F: v4 c
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   8 c& r5 x: u* t8 C
   Else ! u0 I) n7 o* M
     For Each key in Request.Cookies(cookie)
7 \& ~. V4 I" y+ C2 ?1 s     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 3 m/ |' p/ ]. F4 z% o* b6 E+ u
Cookies(cookie)(key))   : ^; N1 p  z0 y, ]
   Next 0 K# M2 E# H  T% K7 v5 S; I9 a
   End If ' J$ C, x( `% I, t6 J; S
   Next </P>
3 Z) W/ [! A2 M  I3 l6 k<>   tbl = MakeTable(tbl)
7 P& ~6 j- E# T6 K) ^4 p+ S   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ! E, b: x% y' b3 D0 F" S" z5 D
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
( P6 z0 d2 y. w! Z   Response.Write replace(tmp,"|", vbcrlf) . L6 E% \) v; w' c8 d* j% a& w
end sub - o6 B& d! \  f2 d. k) u
  % e! q6 \+ u8 [5 Q1 f* c: r, y
'*********************************************************** . t+ Z, G: ?5 s3 X7 s
'* PrintSummaryInfo
: \: Y$ `. A! ~% D8 T'*********************************************************** ( Y$ t& H1 [2 h  B
Private Sub PrintSummaryInfo(byval DivSetNo)
3 l% F* t; t- |( H% u  S; l' o   dim tmp, tbl 1 l8 C  h  X" A7 R# R3 M8 K/ `% u
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ) K% o$ k: X3 m7 C7 y7 p4 F; K
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 1 ^5 k8 g( d* R8 a, K
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 3 H) I5 K0 h1 h
   tbl = AddRow(tbl, "Status Code",Response.Status) ! W/ K  w2 z8 w
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
1 i9 _! ?/ Y! s  C1 }5 t2 H7 b8 N   tbl = MakeTable(tbl)
, w1 b4 e9 _8 d* u0 R, @: q   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ) |6 f0 m5 D" |) D
   Response.Write replace(tmp,"|", vbcrlf)   i$ r8 d$ o2 N
End Sub </P>+ @  f, a" V5 E& R& @; I  A
<>'*********************************************************** 7 ^3 I3 q0 r6 [+ [/ V
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 4 w8 D7 ]: S9 W* f
''@PARAM:  - oSQLDB [object]: connection-object
" P) m) x9 D# C" Y+ k'***********************************************************
, n9 i. P% u: D  q3 g, O- tPublic Sub GrabDatabaseInfo(byval oSQLDB)
- a5 G5 j- U6 O4 g   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 4 {, f$ F7 H  {
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 2 z4 U, R0 g* G! ?* P
   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")) ; Y5 p% Q  A% X4 {1 B" V6 y
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 8 s  Y2 T5 q2 H$ p
End Sub <>'***********************************************************
) R9 H. H3 e' z( L'* PrintDatabaseInfo + ^% y- {  y( ]7 b, s
'*********************************************************** & j* ^( a1 H$ X$ Y0 ?
Private Sub PrintDatabaseInfo(byval DivSetNo)
- k7 w8 Y: j2 A* \5 M   dim tbl 4 @8 @$ L' m7 D) y
   tbl = MakeTable(dbg_DB_Data)   N. m. N. w' S$ M9 y# h
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) . Y1 N9 ~. i+ h- d, U
   Response.Write replace(tbl,"|", vbcrlf)
2 u2 {6 d8 t7 Q5 d0 CEnd Sub </P><>'***********************************************************
# `: Y% V# ?- q0 ?$ w1 Q'* PrintCollection
2 }& ~% Q! i. f: W3 \'*********************************************************** ( n0 }% v, t7 u0 c$ e1 Y) l
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
' C- I9 o0 a# H9 h8 Q* M. @   Dim vItem, tbl, Temp / {  D# y& d: ~- U+ _  k! p) Q
   For Each vItem In Collection
! ~+ R/ Q6 Q5 P, G& Y2 Q. ]     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then : w5 \% l3 c0 @  }6 P* v) i9 Z9 I# R
       tbl = AddRow(tbl, vItem, "{object}")
, @, S1 x. s0 M: U: @* V) v9 u0 U     elseif isnull(Collection(vItem)) then + _& r8 a$ i2 |, h' ]/ ?/ V, A
       tbl = AddRow(tbl, vItem, "{null}") ) _" W5 t7 T$ w* ?
     elseif isarray(Collection(vItem)) then
2 @9 [0 }& `6 D1 k4 r       tbl = AddRow(tbl, vItem, "{array}") . k2 g, z1 n1 s; S5 N
     else
9 |, K' Q( q. P  o  B  [; n; Q       if dbg_AllVars then
+ n2 k4 A8 H4 _% E5 d* j" F       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) & w. l6 ^  o9 ]! U
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
, R8 G8 x' H4 k, a2 H# T% k       if Collection(vItem) &lt;&gt; "" then , J- O9 l- b7 l" J& d
       tbl = AddRow(tbl, vItem, server.HTML* F1 E- e2 v! F
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 2 u% Q, R; U7 `& T; P3 M
       else
% J  i2 N- m& W; ^2 w4 j% C. f       tbl = AddRow(tbl, vItem, "...")
, p0 u3 w% f, f, O2 Y: A( `       end if ! `% x) g" L; E9 r7 `4 V
     end if : V$ w& D( a, y( r; L) t0 S
   end if
: ]2 W8 F  g0 S- B& Q( G; Q   Next
1 |( k# U1 V$ O1 q, T. }  U   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
! y: d8 F$ ]: |) t3 b" D   tbl = MakeTable(tbl) 8 a6 r0 H  m+ N% u
   if Collection.count &lt;= 0 then DivSetNo =2 " F' |+ O1 C5 l3 m/ y0 T. e  y
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ' @/ x* L9 g+ E6 \0 z# t
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ) s! s% o1 x" v6 M
     Response.Write replace(tbl,"|", vbcrlf)
. h8 C/ D8 T) n8 u( iEnd Sub
8 D3 h5 x2 X% d( C  ; s' t, N1 K( M) J7 @
'***********************************************************
4 Q3 o, _9 n; }# S9 v& R6 Q( B'* AddRow
2 q$ y1 Q0 c$ U1 ]: z'***********************************************************
2 s6 p5 t& ~; o. x( [/ zPrivate Function AddRow(byval t, byval var, byval val) - V; f. r: E  U' |: ^8 }
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
+ t) ^+ N& b. Z# K" V/ d# Y! }   AddRow = t 6 I, o6 j' f$ g9 z
End Function </P><>'*********************************************************** / R! p0 [- H" i( w7 N; x/ F; l( d5 H
'* MakeTable
  }9 R# `# s  y  {  t6 i; F9 I- _'*********************************************************** % s& [9 U3 Z, S1 F$ O% K
Private Function MakeTable(byval tdata)
# {6 W2 Q: o& H2 Z9 Y# Q   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
' ~7 @6 K2 g$ q+ M' t   MakeTable = tdata
6 m! i! t# t* B( w( iEnd Function </P><>'*********************************************************** + O3 s8 e- P  _  c! {. Q
''@SDESCRIPTION: Draws the Debug-panel
9 G2 g9 w- }5 m' [) T'***********************************************************
4 r! s$ a: {; H$ @! f  a, w, r+ m% tPublic Sub draw()
. e. ]* C8 ^9 u   If dbg_Enabled Then
; V; o' e% X  S9 X4 A9 F) Q     dbg_FinishTime = Now()
- K1 W' h8 d" ]# o  
. D1 n: [' ]+ k5 ~4 @   Dim DivSet, x
8 Q6 I) w  N2 d$ m   DivSet = split(dbg_Show_default,",") & `* s0 V: E* u* P5 k% G- z
     dbg_Show = split(dbg_Show,",") / C! u4 `% T. {7 i+ x4 ?
  
; m* y0 l8 K, Z; r" I   For x = 0 to ubound(dbg_Show) / H( c1 x' ?3 P* z/ R  N
     divSet(x) = dbg_Show(x)
, K: x" ], Z5 x$ r9 n: r   Next * z: l# P$ ?* w% a' S
  
! t: z( e3 v' _/ h   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 c, }$ s2 g4 X$ n! P/ Z' \; T   Call PrintSummaryInfo(divSet(0))
+ d; Y' i9 q1 m" j; L% A     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
6 F4 b7 d/ @2 n: r, g! F$ Q& g5 F" q    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") : x: n8 o& h7 j, S
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
5 ?+ g' r- \8 `4 G) l# z1 J& h    Call PrintCookiesInfo(divSet(4))
# o3 f8 d" ]6 Z0 ^* X    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))
9 n0 y& K' n  v    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
0 P: k+ L3 U, [3 e% x: w& Z    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 n$ t; M; q. I8 \$ o6 m6 G    Call PrintDatabaseInfo(divSet(8))
& {: W6 t4 V+ k4 C: N    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
1 H3 j$ k$ ?! Z3 f    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
/ u: q2 N( @& o- W& M! U" N    Response.Write "&lt;/Table&gt;"   u( P" B$ q8 S3 ?
   End If
* W5 v( \; b3 z& v1 ?4 qEnd Sub </P><>'Destructor
2 E, `* Y* r5 T9 [$ mPrivate Sub Class_Terminate()
/ ^" V8 w, z0 _: E; P9 m/ u   Set dbg_Data = Nothing
1 A+ O7 b% y: ]# zEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
. r& h. u7 r1 F6 X# KCLASS debuggingConsole + b, Z- f2 |9 D; `
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 I6 U; L  u. N" Q
&amp;n
, t/ l* i: \7 F! tbsp;
# d% L8 E$ ]; n  ]9 H  oProperty Get Enabled===[bool] Gets the "enabled" value
- L# q5 ]( _: N, P+ Z  ) \0 j" M9 E7 _9 M
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 + a! r/ D5 y8 @: s4 ~5 f
  ; S% }4 E9 {! ]3 D' I9 K) n2 ]
Property Get Show===[string] Gets the debugging panel. ' z0 W$ [4 V/ r/ Z4 D
  4 ]% N2 Y/ P! z0 R' V3 F: l- W8 Y( B
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><>-------------------------------------------------------------------------------- $ [. U' E' R! C8 Y' e
Public Methods </P><>public sub===Print (label, output)
: q/ Y" g) g7 ^" R   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
6 M+ g) ^- O0 U4 x   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () + V' Q5 y- t0 |& [8 T& U5 W' p
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
6 |; D. f/ X4 ~1 d. \: d1 |Methods Detail
! y1 A8 u: \% R5 J  ( F/ Y3 e. W) v: t( b
public sub===Print (label, output)
% b6 a7 s2 s0 V: i' X5 X$ X+ pParameters:  
7 C* G1 J- d! p4 Y, H/ p! d   - label [string]: Description of the variable 2 t( I( e- C0 U! ~
   - output [variable]: The variable itself 6 ?; Y; @$ M7 Q3 ~. e% Q9 r
  # G. @  |1 N9 q& Y2 `0 J: \
public sub===GrabDatabaseInfo (byval oSQLDB) 2 q7 w. l% F; g; O
Parameters:  " B9 k2 b8 y- w
   - 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-9 08:01 , Processed in 1.344664 second(s), 56 queries .

回顶部