QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6327|回复: 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: O2 q: T. U1 A1 Q
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 0 k% l0 p6 e4 A3 I  O% g
使用方法很简单: ' V9 g" x+ h5 |
test.asp </P>
0 G. W1 Y6 X. f8 p2 W' r<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
" a7 p4 \6 H7 u  |- |: S&lt;% / ^* Y  o6 J( W# F8 Q7 a, d) I
output="XXXX"
1 v; [) y; f8 }) M3 X2 XSet debugstr = New debuggingConsole & n/ T9 I5 }$ S( t" v
debugstr.Enabled = true
$ }. y% T) f) w; L# J   debugstr.Print "参数output的值", output
9 q7 U. ?) O2 w) W. E9 `   '…… 7 s! @, o7 W8 Q% Z2 ]3 A2 D  o
   debugstr.draw
4 t, o: u, R9 r2 ASet debugstr = Nothing * o4 V* ~' D8 }% N* [& d
%&gt; </P>  V2 Q- F" B9 j. B! J* q6 t: O
<>=================================================== </P>& M" k( A/ _& H# y
<>debuggingConsole.asp </P>5 z( S4 [% v. `' E
<>&lt;% . e2 q# c' M- T9 E$ u
Class debuggingConsole </P>9 `* z1 N6 H1 I1 ^1 C1 s9 p, n
<>   private dbg_Enabled
( y1 K0 l' [9 d  R1 {   private dbg_Show
! {; ^0 @7 [( D' v   private dbg_RequestTime ' ~( r8 i* J7 c$ l: z* f
   private dbg_FinishTime
- F2 }' g! M4 J* [1 Q# d, }   private dbg_Data * w  W. L+ B8 G3 t' Y
   private dbg_DB_Data 8 H4 O& O: e. O7 {
   private dbg_AllVars 6 t! n/ I) Z" i2 ]) i
   private dbg_Show_default $ |. s! w# e& @
   private DivSets(2) # A8 d) @. }, K. ]# g6 F
   + j$ x5 G; b1 i. t, Q6 h1 P
'Construktor =&gt; set the default values
& R0 Q' h/ R; b+ G% x4 nPrivate Sub Class_Initialize()
" Y" _# G" W7 S( z. o   dbg_RequestTime = Now() ) @$ a& m1 s' ^  S
   dbg_AllVars = false ( u2 r; B, O2 p& X* k8 B
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>: ~5 A6 {6 P, c* B* G: @; ~" A
<>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>" l/ \! M+ Z5 e3 J
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;& O5 ~- ?  q4 r; l" y+ w# @
&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% g4 C& T  X1 I$ F! g& J; F<>   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>
. S( N1 Y1 a8 W/ ?. ^<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" % |1 c# c* V, e
End Sub </P>
8 M$ q, u! [( q) {. |% S& [* {<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false % Z4 N( E; d+ T
   dbg_Enabled = bNewValue
1 g7 }; R* R  U* ]  f9 LEnd Property </P>. k) F9 f& d7 R4 W2 V0 ^, x4 c. J$ m9 @
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 7 `7 [1 Q% U) B& L% c: ]2 Z
   Enabled = dbg_Enabled
8 C+ q6 \9 i8 ^End Property </P>7 a. q. x% D. y: [( 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 . F  \1 ~8 F* O0 p) ?4 L
   dbg_Show = bNewValue " w0 _' e  ~& C) B
End Property </P>& F' z1 J+ j+ T- A# ^6 V! Y
<>ublic Property Get Show ''[string] Gets the debugging panel.
, R+ ^: z8 v6 @* Q) l   Show = dbg_Show
* y% s/ H6 B, U* N: m/ }5 DEnd Property </P>
" e, Z2 e# D- k) t4 ~<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false " x( g* Z; {# B5 D: e; k! G
   dbg_AllVars = bNewValue
* n9 a9 {( |8 B2 w7 aEnd Property </P>
5 l4 g$ j; \) ^& Y! b<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 1 y6 A& n; q& q! r' B$ X% O4 G
   AllVars = dbg_AllVars 5 J2 h$ P) V- \3 o: A
End Property </P>; d4 q: I, k8 x; g2 h/ S
<>'***********************************************************
4 W# F, `. i& K% s0 J4 h''@SDESCRIPTION: Adds a variable to the debug-informations.
2 E6 A2 b3 ^* Y: |9 {$ P''@PARAM:  - label [string]: Description of the variable
, l. y* |4 c4 @" q( _''@PARAM:  - output [variable]: The variable itself
$ E) _' C3 P! w'***********************************************************
1 t4 A9 o/ d( ~Public Sub Print(label, output)
" w5 U6 [6 g5 R. l* i/ G8 a   If dbg_Enabled Then 6 h- ~2 k" ?; p- I
     if err.number &gt; 0 then
; [3 f( j( f+ x& N       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ) P" }! V, x2 l# k6 c
       err.Clear ; D7 d  R; ^8 i) c7 y: D; @
     else
- O6 ?  z) k0 c! L       uniqueID = ValidLabel(label)
( P5 f% ~2 M6 H! {& G) B1 Y       response.write uniqueID
8 S& y7 @7 n4 L- {5 O: d& j       call dbg_Data.Add(uniqueID, output)
! D0 y, Q' b- n2 U2 z: h- q     end if
( D) N1 o# ~. b" |& K7 u/ }   End If
% \" O0 ]+ W5 i. c6 s; l) e0 A& u7 S. SEnd Sub
# u, i- n; O) c) \2 C4 s  7 T, _6 I! Q8 T8 W- g& O2 b$ e
'***********************************************************
2 m, {( ?8 P  ^  h'* ValidLabel 6 P9 B6 T3 o' _
'*********************************************************** 4 d* }7 H: B' Q1 U
Private Function ValidLabel(byval label)
, e- r( ~1 D( q" P2 G0 @   dim i, lbl
1 A7 ~0 g9 g4 v   i = 0
$ n; n2 N+ T$ I% E# v/ f: J   lbl = label ' J& D! Q! g) x" |
   do
2 d' o9 e7 R+ h. s/ }  ]# l   if not dbg_Data.Exists(lbl) then exit do
6 Z) x& Z' G0 l3 `8 B+ W   i = i + 1 + v7 |7 ~& i0 C6 R
   lbl = label &amp; "(" &amp; i &amp; ")"
' ^! N- k1 [5 O# ^   loop until i = i " o- {; A2 p" }% w6 k" s, X
  
" Y8 p0 O+ w/ m, [1 J( F   ValidLabel = lbl
5 Q1 j- F0 k( E# NEnd Function
8 ^! Z# N: S. M  _" O. e5 g  
$ M) J& T$ ]9 M7 n, W5 f6 y'*********************************************************** 7 M! S5 r. Z  A+ g9 h2 ?
'* PrintCookiesInfo
$ x( ]( P" M0 Z'***********************************************************
6 D1 Q2 W9 P6 C. r$ VPrivate Sub PrintCookiesInfo(byval DivSetNo)
% R/ m2 r$ W  \: `/ z6 w) p   dim tbl, cookie, key, tmp - g5 M! a! s8 [# R3 R( W
   For Each cookie in Request.Cookies / \  @+ q% F( P
   If Not Request.Cookies(cookie).HasKeys Then + m1 B3 G% m3 B- x0 I. [
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
; t7 S3 p1 i# l4 `: |6 X; o   Else ) p2 P1 U( b. _7 r3 m* S
     For Each key in Request.Cookies(cookie) & V) g1 I8 t/ w& G$ s" Q
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 7 m8 W2 O! F0 I; w
Cookies(cookie)(key))   
1 T' X- a, ^# m' h, x8 b4 n* \$ d, P   Next 7 z- E/ k, w4 f
   End If $ U% h1 `8 c3 g2 T# G
   Next </P>
; w8 Q1 @. O2 |/ V<>   tbl = MakeTable(tbl)
0 K; X! [) A1 Z   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
! ]2 l$ v6 k. |4 D! J   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 0 x; }9 j0 {1 R9 j" W6 s/ V& J/ m
   Response.Write replace(tmp,"|", vbcrlf)
0 r6 b, N" c: g: d* L8 @/ qend sub
5 {' C* e; m/ l* T    Z/ O. o6 W! h' D' [
'*********************************************************** ' f4 @: D  z2 ^, S& y; D" o+ ~$ Z% Z
'* PrintSummaryInfo , i  _% ]; H; m' t1 o9 [
'*********************************************************** " h0 M* k' F: v) k7 @0 s: ?
Private Sub PrintSummaryInfo(byval DivSetNo) 5 x) I+ N! B; U. m& P4 j6 s
   dim tmp, tbl 7 h: j  o. l4 N+ i2 D+ D& U, I
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) / n$ X* O9 \( b; @1 R
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 4 k4 w8 V3 A% R. |5 @+ G$ e" V" z* T
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 4 p9 Y* M6 r  m) u  W( [& J
   tbl = AddRow(tbl, "Status Code",Response.Status) & h+ ~3 F6 }& m5 f. _. K$ f
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)   y0 L0 Y) G6 f3 ]
   tbl = MakeTable(tbl)
; d& z, |8 z# b7 ~  ^+ m   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ! I1 j' o2 x& M4 {
   Response.Write replace(tmp,"|", vbcrlf) , \: ^/ k; M- I' f. k, F& K
End Sub </P>' _( c0 T6 a' G4 a) J9 |- [$ r6 v
<>'*********************************************************** & k* a4 k3 J7 J- D1 U
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information " ], v. Q4 T" X) L( m
''@PARAM:  - oSQLDB [object]: connection-object
! `' ]2 H! x6 l3 z* I% M'*********************************************************** % G  f7 T) H9 D) @5 A8 n0 O0 ]( y
Public Sub GrabDatabaseInfo(byval oSQLDB) + e2 Z( E' m5 u; K
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
. s5 H3 x4 T/ D   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 6 X* c) h3 z9 P" S( B
   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"))
$ X; w; \) G: O/ E6 h   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
9 E3 @; \) S% I9 _) }; S' aEnd Sub <>'*********************************************************** + e2 g# C* {" V7 m4 W+ }4 w" b
'* PrintDatabaseInfo
2 @6 Y6 J7 V6 e'***********************************************************
1 U8 d- X; \5 V, J6 q. V2 s  APrivate Sub PrintDatabaseInfo(byval DivSetNo)
* _! d4 Q6 t! w1 z+ `6 q; H   dim tbl
8 u5 @4 D' v/ _! h8 A5 N. n/ l   tbl = MakeTable(dbg_DB_Data) 8 ~0 T4 {* ?! R/ U( ~
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) * ]4 x* T; z+ {1 F
   Response.Write replace(tbl,"|", vbcrlf)
. M( q4 K  s! |1 W& q9 EEnd Sub </P><>'*********************************************************** 2 C  r0 a% f) |( K4 S( ^
'* PrintCollection
, F1 U& e( x, b'***********************************************************
. m+ N' g  _  i. \! Z1 O$ WPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 O# |9 V# H& i$ C; g5 o) W% S$ k0 Q   Dim vItem, tbl, Temp
: j- }4 C8 H* t; N! Z& |) M# f   For Each vItem In Collection
2 A7 k, w5 K& L) O2 Q     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 3 V$ ~8 A: a" i% J- o2 u( C
       tbl = AddRow(tbl, vItem, "{object}")
) p3 `2 p" H+ w1 @     elseif isnull(Collection(vItem)) then
; R+ x  P" P* Z& ?6 h( z8 ^       tbl = AddRow(tbl, vItem, "{null}")
: Z3 ~. ^$ Z. j: N6 g( t     elseif isarray(Collection(vItem)) then 7 Y8 r+ d0 t" R, a
       tbl = AddRow(tbl, vItem, "{array}")
& Z7 S5 I& Y9 m/ F6 z     else
  ~% a% [7 e4 J2 K  B       if dbg_AllVars then " F2 G" O- B( }% z, v' b9 p
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) # h! w% `$ t" [3 V* L
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 1 R7 U9 G+ |* f/ r3 R
       if Collection(vItem) &lt;&gt; "" then
0 G- h' E6 |" K       tbl = AddRow(tbl, vItem, server.HTML+ R# G3 ~8 Q# {0 }9 L  G$ Y: d1 o
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 3 u% |( h+ `9 T& W3 {5 b) k
       else , L0 y( M* i* ~+ h1 \# s" m0 e- [% g
       tbl = AddRow(tbl, vItem, "...") / g. J% Q4 s% d! x8 L2 Q4 s
       end if 2 F3 n! H: b0 x5 v
     end if + Y& R) g# K! N3 N$ y$ A8 W
   end if 5 }5 E, y1 B- s# W
   Next
' \7 t  E% X% @5 v, W   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo + l9 U7 o8 G, }, P& F; N' d
   tbl = MakeTable(tbl) 2 l5 u8 Q6 q2 U; j  ^
   if Collection.count &lt;= 0 then DivSetNo =2 ( X; M, R5 b8 U' |4 g1 y4 _
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 Q6 e4 _1 c5 G" U* R* R
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 m; r" x# R8 v6 ]' Z, `/ D
     Response.Write replace(tbl,"|", vbcrlf) 0 B" b& }2 T. d  G3 y; g
End Sub % @" ^$ z& J. K' ~. ?; o# u
  
3 u  _" e+ M0 Y' D% y'***********************************************************
- z9 t) \1 M3 I0 H& j; n! C'* AddRow + o1 M: W9 v5 x+ s7 R
'***********************************************************
, F; t# R1 n7 r5 V! K* LPrivate Function AddRow(byval t, byval var, byval val) 8 g: K, B8 ^9 _
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
% S* B3 U, G1 N0 J" u   AddRow = t
' J( A2 [: N. E5 }! z- ^/ TEnd Function </P><>'*********************************************************** ; v* Q0 C: P* ~0 W/ b
'* MakeTable - P4 H( b- E# K
'*********************************************************** 5 c2 K; D+ p0 H$ f
Private Function MakeTable(byval tdata)
/ q7 I& R( \5 Y: b* z* h; Q   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ; E3 ]; Q6 P: S/ Z9 W* ?8 F7 M- r
   MakeTable = tdata
. p1 [* s* z) p8 X/ E# @0 h2 }) tEnd Function </P><>'*********************************************************** . A) }# Z: A& `- a
''@SDESCRIPTION: Draws the Debug-panel : `" Z4 L3 D& j1 q
'*********************************************************** 9 g% s- x" |% B$ v
Public Sub draw()
& V6 u: ~8 l; }5 A" Q, N/ K   If dbg_Enabled Then
; ^# y8 N9 l% w     dbg_FinishTime = Now()
9 O6 R5 O" b) W8 p8 L  - D& T# M! K/ P# u/ O7 l
   Dim DivSet, x
8 K" h9 B' ?, e- o. {: l   DivSet = split(dbg_Show_default,",") ( B  q. L" w( x( y% C
     dbg_Show = split(dbg_Show,",")
$ |# K, `% R7 y5 m1 g+ i* y, H: L  
! l9 ^+ m* A( J' t1 B, p   For x = 0 to ubound(dbg_Show) ( }6 U( q! \, w& Z0 X5 ?! S7 H
     divSet(x) = dbg_Show(x)
' W2 ]8 w  p9 A, v- {+ _! \   Next 4 S* \6 `: n& ]# L4 H! i
  + i; Q- _6 `' _" I$ j
   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;" 8 \+ @9 r- Q3 T- e( M8 X. X: @: X
   Call PrintSummaryInfo(divSet(0))
7 h! i/ h$ z# X8 b% d  p* Q     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
9 h. l" y- X, X. Y% R6 }    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( p( p% \# ~1 V5 D. b
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") , k( v4 ^* q% i, `& P
    Call PrintCookiesInfo(divSet(4)) 0 P* e/ R$ d! T- q6 Y
    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( f5 O1 q/ d, T. R& Y    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
& z5 \) b3 d/ A8 Q  B    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' G2 b- M% U6 }5 a    Call PrintDatabaseInfo(divSet(8))
2 H+ t2 |1 n1 `& k5 |  y, I    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 e1 E4 \5 R# {! L' @+ o7 s! \
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# U( t7 Y- @* l) t  x0 h& O    Response.Write "&lt;/Table&gt;"
3 a) i* H/ m3 L: E   End If
( a: n  d4 S0 k; tEnd Sub </P><>'Destructor
: ]+ t: u  C" C4 _/ IPrivate Sub Class_Terminate()
( m- o+ z" r) `- f   Set dbg_Data = Nothing " @9 |( w% v; K/ F
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>; S0 b  [  {0 G4 |! s
CLASS debuggingConsole / [5 E  `7 V9 t8 q! h+ ]7 E
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 }- A' \6 h2 U) R6 M5 ^' w
&amp;n0 H7 A" O- J6 @
bsp; ( B7 f3 g6 B$ P1 e
Property Get Enabled===[bool] Gets the "enabled" value , B. S  b  w5 `! n7 J5 e! i
  ( ?" p* w% 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
( e" X) ^- ?7 r7 Q  $ G; X9 ~4 d. m2 E7 z! ]9 h" G
Property Get Show===[string] Gets the debugging panel.
" y* K" x1 M; X  % J! S2 w: u7 T- 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><>--------------------------------------------------------------------------------
. e7 I% c; v9 \# L" l# mPublic Methods </P><>public sub===Print (label, output)
; b. x! ?1 A6 X  c   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
  B2 l2 o) s& [6 a2 a# E- m9 F   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
5 n- Q1 E; @1 J. \   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ( j  z& K! n% z9 b
Methods Detail
' u. {4 k1 u+ F' P: T  
0 _- w+ V# c$ A) T$ f; a6 }0 w& L( gpublic sub===Print (label, output) - [9 W/ c# o1 D$ H. L8 m7 l
Parameters:  
/ X% s. O- w" S- M0 E" I2 g   - label [string]: Description of the variable ( f, p  t5 g6 z6 X: E
   - output [variable]: The variable itself ' R! L6 z% S, l- k2 C2 K
  
2 I9 @  @6 ~  Q+ K1 Rpublic sub===GrabDatabaseInfo (byval oSQLDB)   o- d- g6 Y  H) ^  n; [; S
Parameters:  ) J) w8 W) ^! V0 C1 l9 d
   - 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-10-15 07:31 , Processed in 0.541859 second(s), 56 queries .

回顶部