QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
% {5 y9 Q3 [+ V6 X% z8 R<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ) V6 m4 I6 G2 J8 Y) f1 ~
使用方法很简单: 8 G8 L, u( Q* I# i. l, m1 p* R4 c
test.asp </P>+ ?* _* G) {! S% ?% f: U
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; " }7 m% o5 y6 Z
&lt;%
) `1 x! h" |3 N0 Youtput="XXXX" * e7 m1 o6 |  E3 _# {  G
Set debugstr = New debuggingConsole 5 o" ^' V; X' w+ C! \& a; j* w0 G
debugstr.Enabled = true
* K8 M5 c7 V) ]: g- ~' A   debugstr.Print "参数output的值", output ! e( ]4 z& I3 W/ k7 w1 D6 B
   '……
% u) ~' m( P: U6 }# Y; X+ f   debugstr.draw ) f+ [9 _9 [7 O3 F! X5 w* r# g1 r+ G
Set debugstr = Nothing ; P% _: g' b& {. |
%&gt; </P>
* }9 H6 N- |0 l<>=================================================== </P>
! ]1 r0 c. f" w- E<>debuggingConsole.asp </P>5 r4 I/ _8 r5 W
<>&lt;% 0 _! r4 S1 |8 @6 f9 z( `, _
Class debuggingConsole </P># U9 j& P& s) b' O) U) G, n+ i. n" T
<>   private dbg_Enabled
/ [5 F  Y9 P# ?  z" i) x* w0 a   private dbg_Show
* E8 c" L- G5 }1 S6 n   private dbg_RequestTime ' i4 A  M6 K" i3 ~# o. h. V
   private dbg_FinishTime
. y3 g7 i2 U, ?# q  n   private dbg_Data 3 F* e0 a$ g* c: q) x/ }
   private dbg_DB_Data : l; R9 ?$ J( V) b. ^% X
   private dbg_AllVars
# T# X4 b: A2 K   private dbg_Show_default 3 G* e# L4 e6 Y: p" ]8 t0 F
   private DivSets(2)
- w8 B9 S# X" g4 n   
1 [& a. m% K8 O# B7 N3 w( j6 S8 B'Construktor =&gt; set the default values 0 ^/ X8 q9 c; a
Private Sub Class_Initialize()
' r7 F' x) u4 [& y# ?4 C   dbg_RequestTime = Now() 9 j: N- b4 M8 M) g' _" G7 g
   dbg_AllVars = false
9 k  m- B. Z1 t% R% E0 U4 b1 Q  J   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
2 p: D. }. r0 }7 Y1 B<>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>  o' |4 l/ ~, B
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;& f9 b/ q: m3 I' r* u( t( S+ o5 N
&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>
  y2 O, l' x: V( ~1 b<>   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>& F+ g5 s! f( x3 E/ l! h, S4 h
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
2 r0 M) y0 v+ Z; ]# A) EEnd Sub </P>! F9 G9 M0 p0 L3 [- {
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false " b4 P% P* D) z
   dbg_Enabled = bNewValue 3 I9 d  F8 U* t+ R! V7 K7 g
End Property </P>
8 H8 l% s% w; O: @* y<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
5 A, Z5 @( D, E  _% B% t4 I# [2 u   Enabled = dbg_Enabled
" G' U- v/ R7 P" P; YEnd Property </P>
+ [7 O- [; e4 E9 {) ?% N<>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
- m$ p6 z5 _& B0 c2 E   dbg_Show = bNewValue 0 I7 N) H- w1 U0 o/ C6 D  j" \
End Property </P>+ U+ D! f; F. O% r
<>ublic Property Get Show ''[string] Gets the debugging panel. & _5 n' ^3 M7 I) S* p( I9 m
   Show = dbg_Show
% }) @0 ?6 K1 H9 tEnd Property </P>
1 I0 v$ V" L0 y) c. C1 G( Y3 r<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 2 p+ t9 R1 o" s4 `
   dbg_AllVars = bNewValue ( b& |- o, S7 Y3 q
End Property </P>
0 d3 C. \, S/ {& F7 K. f<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
% |  s! H4 ?( ~8 T5 |7 x: u   AllVars = dbg_AllVars + p, u6 I1 c5 {2 m
End Property </P>
: A+ y) Q8 n1 u/ x& X3 W<>'***********************************************************
# T8 o- _  c- F''@SDESCRIPTION: Adds a variable to the debug-informations.
2 N* C5 X' F5 _; Q''@PARAM:  - label [string]: Description of the variable
& h% z2 }; r* k5 T''@PARAM:  - output [variable]: The variable itself ; e2 j3 F* c7 d4 K  Q- J* g. U
'***********************************************************
* {. I; X0 H# tPublic Sub Print(label, output)
8 s3 F  S) H/ E0 r/ j7 _2 C  l   If dbg_Enabled Then
" v' D2 e) B' B7 \6 o* ^6 z2 l, ?$ {     if err.number &gt; 0 then * U' j; D$ P& V5 a
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) . O4 V/ I0 C# M* A% K* H
       err.Clear
9 c! p, v5 E  n     else 5 f  U- H& u7 |+ \: h
       uniqueID = ValidLabel(label) - w% s: I4 y5 X) V$ c9 P) I
       response.write uniqueID
% f. i6 t+ @7 E/ _+ f       call dbg_Data.Add(uniqueID, output)
  ?1 w& G6 D5 Q/ }3 h# v( f  Y$ b     end if
) l$ F4 w. ]" {1 P- V- r  Q   End If
, w& ^, h' c1 l* S3 h: N4 ZEnd Sub
- [$ l% o; a/ V  
2 G0 r8 ^% g) s9 d0 [8 s'*********************************************************** / \* v4 D- N0 a
'* ValidLabel 1 M! P. V. p8 y# L0 C, |
'***********************************************************
% _/ n+ O7 {" V4 w# e$ x- ^/ kPrivate Function ValidLabel(byval label)
6 f# t. ?6 x$ r5 O$ G4 r   dim i, lbl
; n/ S: D: @1 a9 o   i = 0 $ }: O1 E2 Z+ s
   lbl = label . E3 ~, I1 ]# \, @( e8 y
   do ; m* b" \5 Q% @6 d
   if not dbg_Data.Exists(lbl) then exit do ) U0 @: X& f. O0 J: Y' V
   i = i + 1 3 o. N. H. M9 L* A
   lbl = label &amp; "(" &amp; i &amp; ")" . `9 o' O& T! }3 w8 @9 {7 n* n
   loop until i = i ; Y5 z! V" A5 R6 z9 \
  5 H$ E& ~( n- e, {
   ValidLabel = lbl
) x4 p8 K$ ]# p( A) v$ |* w: xEnd Function 2 N) D% Y- e$ |& g" X! g
  $ r* }# B* ~5 }% t' R& l
'*********************************************************** . g5 f% I' p9 K" L5 Y
'* PrintCookiesInfo # x: Q# u( B; k0 Q
'*********************************************************** 9 Z, |5 l! Z2 \& U
Private Sub PrintCookiesInfo(byval DivSetNo) 9 ]3 I" Y# y, j' W5 y% `; b* y
   dim tbl, cookie, key, tmp
/ v7 a, D# v4 E, S2 q   For Each cookie in Request.Cookies ; {" M0 d+ d# S2 F1 x
   If Not Request.Cookies(cookie).HasKeys Then
  s" f0 y* c/ i+ Z  S     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ( M* ?8 |& i5 o( m4 M
   Else
) l- k) t$ y# C5 w$ Q: T     For Each key in Request.Cookies(cookie) 5 b! J2 t* ]+ O5 s  l1 h3 P
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. % Y  _4 S) K; _9 F7 ~$ W5 Y& n
Cookies(cookie)(key))   
4 S$ S- t  q1 Z   Next 8 X7 S7 d+ D, [
   End If
/ `4 s7 z% L$ ]1 W2 h, W   Next </P>
. W. P4 R$ A; O8 C# ]<>   tbl = MakeTable(tbl)
2 K8 C6 w4 J6 v/ V- @   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
, {5 Y. w( j- P  F   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) $ `# G0 l8 c# B; L: b! C
   Response.Write replace(tmp,"|", vbcrlf) 2 `! l" q- O, S' ]3 g1 G* q
end sub
; v5 J# D" m9 S9 F% q0 C; S3 {  * L6 n- u8 C  R+ _2 `
'*********************************************************** $ O  Q9 Y* x, d
'* PrintSummaryInfo
4 k) W& s7 V! ~- A$ ~'***********************************************************
* @7 j. Y6 V5 X% S" kPrivate Sub PrintSummaryInfo(byval DivSetNo) . \. J( _. y3 @9 z5 G
   dim tmp, tbl
8 x' w) @3 k* t4 K1 w) q9 L& I   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - u7 V; A3 Q0 _% y4 C, c$ U; S, c) v
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") & b7 _' I, M, e2 l; m/ Y
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 0 n4 I8 l# m% M, o: `0 V5 S
   tbl = AddRow(tbl, "Status Code",Response.Status)
  f/ G6 i, {: O# W  v% h0 d( V- F$ y4 F   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
" A7 {; y# r( F   tbl = MakeTable(tbl)
" m: M; r% S" l2 g   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
+ c& r; b1 m7 c: @; F6 J* w( F1 }& x   Response.Write replace(tmp,"|", vbcrlf)
/ c- T+ ?0 _% }End Sub </P>
# k, C4 T" ?4 ]& D$ t  D<>'*********************************************************** 4 y- Q5 I8 F7 k9 s8 C3 i
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 3 q$ I' s$ s4 h! \/ `9 W+ @6 z
''@PARAM:  - oSQLDB [object]: connection-object
1 N' [: x$ ]7 D& T3 T'***********************************************************
3 }, l2 x2 Z7 `2 @) B2 fPublic Sub GrabDatabaseInfo(byval oSQLDB) / ]1 ~6 X8 A' @
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
+ d% N* _, t1 I% a! m) }% |6 A   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
5 ~- \9 E- T  w   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"))
' K2 X8 F) D# l, @$ J+ Z4 }( Q0 k   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
! M! i+ [9 M. H6 k. _End Sub <>'*********************************************************** 7 {; h6 R: t, |$ t) O% H# `1 m
'* PrintDatabaseInfo
8 l/ z. ]/ \) ?; I& V8 i: g'***********************************************************
8 @; M/ @8 N# @0 u8 FPrivate Sub PrintDatabaseInfo(byval DivSetNo) ' S1 k& _+ }& T6 I3 p
   dim tbl
( R) j* l) h( I   tbl = MakeTable(dbg_DB_Data) , r  o- Q, p$ j- S$ S3 L$ H7 C+ |
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" q& ~# V. j0 ^6 t0 x( v   Response.Write replace(tbl,"|", vbcrlf)
' \, Q. [  z1 }3 B2 D- nEnd Sub </P><>'***********************************************************
% N5 x& P9 N; {2 ]) A, y, E! N'* PrintCollection $ F  }) x6 h: x' d
'***********************************************************
/ c. _5 g, c1 r% P0 ^- F5 bPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 2 z) T- N3 b7 o3 Y* J
   Dim vItem, tbl, Temp
! ~9 }' K# D& t* ?- v0 r   For Each vItem In Collection
: c+ i- Q7 s; U6 ?5 u; |     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 6 w" I$ K6 R5 _! D  w
       tbl = AddRow(tbl, vItem, "{object}") . [8 x4 s* L; n% U+ K( w
     elseif isnull(Collection(vItem)) then + Y/ A& t; d' G0 x8 ]8 C8 W
       tbl = AddRow(tbl, vItem, "{null}") ) J% j- t" |7 I- \7 W' M' E3 J$ ]0 g
     elseif isarray(Collection(vItem)) then
! y# R6 ^! n8 Q$ V4 p1 r5 \       tbl = AddRow(tbl, vItem, "{array}") ; C5 J2 ~3 {5 n) X7 X
     else
- o! K1 n6 E& `$ g1 v+ L1 `       if dbg_AllVars then
9 X+ p( K% Y" q/ Z) u" }( |9 ~       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
8 f+ ~9 R$ j. c7 S8 `: B2 O/ Z     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
) S' c. d, B2 `! {5 d- O3 F$ X) u       if Collection(vItem) &lt;&gt; "" then 4 w, A5 y" z9 r. M5 F8 y5 B
       tbl = AddRow(tbl, vItem, server.HTML$ S+ C7 L/ a% X3 u# o
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
/ S5 O1 l2 N8 S6 t# y4 g       else
  S# o- u- v. V& B       tbl = AddRow(tbl, vItem, "...")
+ Q& Y. L$ T& ~& ^/ a7 l) q9 E       end if
9 O5 g3 b2 ?3 O5 X+ U8 [9 }     end if - U# \- }# j- s
   end if
& p+ p9 @+ O# B" \. z   Next
" u6 v- C$ q0 L8 q   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo : o- H  e: |! }
   tbl = MakeTable(tbl) 8 b& b8 T* A7 a# ?4 Z- G% m. t
   if Collection.count &lt;= 0 then DivSetNo =2   Z; u3 S, T. g" N, [, X
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
* f: _% L4 N# m# |; _     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ) z4 R: m6 o5 f: M- [# w1 i
     Response.Write replace(tbl,"|", vbcrlf) 6 \. A( ?% o4 f9 Q7 |7 g
End Sub
+ S4 M" k* n# U( |  s, N# @  0 E2 ]7 K5 I) A, P
'***********************************************************
$ z. Q# J7 d5 i: G- F. I9 s5 R9 }' b'* AddRow 9 f  T, P! O% o% T* z5 m# p* j
'***********************************************************
1 P$ w! c, g9 j" z+ {Private Function AddRow(byval t, byval var, byval val)
) y. b' U2 H7 U3 W   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
- E2 S. L& h1 d' s4 H   AddRow = t % u, ^" P0 j% C) m1 F
End Function </P><>'***********************************************************
0 g4 I# [: L4 o, E" e/ `'* MakeTable
8 t* }1 F, v; i. x, y'***********************************************************
/ u. @1 o/ u$ ~, {  kPrivate Function MakeTable(byval tdata) . x& V1 F* M! r0 f$ y' }9 W/ Y' n
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
! h5 S; [1 Z- u$ Z   MakeTable = tdata - R0 u: d( j# w9 F) d7 q% y4 y
End Function </P><>'***********************************************************
5 o$ W9 g. k5 _, W, D2 l( W  |''@SDESCRIPTION: Draws the Debug-panel ( h8 c8 b8 V/ ]5 }& v- L
'***********************************************************
$ @; J3 \% ^5 v+ j& BPublic Sub draw()
$ u: g/ d2 H! z6 K3 N# Y   If dbg_Enabled Then 7 V; Z) e; N4 E. }5 E7 V& R. |
     dbg_FinishTime = Now() % O: n/ [. u0 ?: }7 {0 ~! |* q
  
4 j; Q7 ], c- f. k' k4 b$ j   Dim DivSet, x / }& I% P/ [& m
   DivSet = split(dbg_Show_default,",")
* u% Q) x: i! n     dbg_Show = split(dbg_Show,",") 2 a4 Q5 k% r- y( u7 O, Q
  
( h) k: `* i0 T9 |   For x = 0 to ubound(dbg_Show) 0 W! `2 h% c8 E7 t3 }1 d
     divSet(x) = dbg_Show(x)
) l3 D2 Z" C+ _' A  z   Next
( ?% o9 U1 }1 a9 W) R5 R  
* f$ }! ?& Y8 G4 W   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;"
# T* A! X9 d/ C. o8 W: s8 S   Call PrintSummaryInfo(divSet(0)) ! h! ?  o/ O8 g  T4 N
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 0 J5 y. b5 S' K; y  z
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ) L# R8 U( U+ y! a# R' G
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") / Q3 ^/ c2 M6 |
    Call PrintCookiesInfo(divSet(4)) 6 f: k% v3 B) n% {: g" G0 s
    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))
/ n* J- s" K8 x* P) F$ P) _    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
2 B$ a5 f/ C7 ?% [    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# N) C) g: t! ]% N    Call PrintDatabaseInfo(divSet(8)) , y+ X8 E6 B7 R& h1 x0 O+ H
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")   j0 \. p! \) T+ ?9 W, t9 j
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") $ S3 C+ M7 z/ h/ `0 u1 z& b
    Response.Write "&lt;/Table&gt;"
' Z, u6 \5 z. t/ x% B# B4 v% J: A' q   End If
4 X4 J3 I- x- U! c  LEnd Sub </P><>'Destructor
; F( Q2 {: ]; s7 X' wPrivate Sub Class_Terminate() 3 q' ^+ R% @5 }& O0 Z! H
   Set dbg_Data = Nothing ; ~* p2 j# N; S0 i* e, ~# f8 {
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>; ?- J8 j; N' K5 ~% x7 h$ M
CLASS debuggingConsole / {* ~7 m$ H6 w, ^
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 @4 w. L2 `; p5 |2 t7 t& H2 X&amp;n
& H" m) m3 V) c* L& B4 A! zbsp;
0 z- c: c. y8 eProperty Get Enabled===[bool] Gets the "enabled" value
7 Y1 W# V7 @  N  
  a% ?# g: Y  P: U- ^# ~; J  {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
5 c; f/ T+ q" A* r. q  4 e# W. E* f9 e
Property Get Show===[string] Gets the debugging panel.
& R2 |% E3 |! ]0 }& u* Q, K  
  {2 b* V8 S# fProperty 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><>--------------------------------------------------------------------------------
0 q  Y& t# B( z6 X; l, mPublic Methods </P><>public sub===Print (label, output)
/ c) j( B* e1 ^) T4 U   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
0 i/ d" P; a2 E& i' _   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 0 `" \/ v- P& \6 ]+ S% t+ K
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
. c% r2 ]" u4 W$ gMethods Detail
& D+ N# \: B% A( Z/ u  
' r" o* ^& h: e5 s# d2 _public sub===Print (label, output)
) [9 I$ {8 ~* y( Q/ lParameters:  , `  N8 _. p( X; c* e# G1 i
   - label [string]: Description of the variable
$ M0 Z( u9 v* X, p' P5 M   - output [variable]: The variable itself
% E8 h% c- q& |  
6 [3 u8 ]6 K) W' m" b8 Y6 vpublic sub===GrabDatabaseInfo (byval oSQLDB)
# r  j( h6 X" _# S8 w, m3 `7 MParameters:  * \4 O) f1 p7 w4 a: J9 x
   - 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-9-20 03:58 , Processed in 0.459690 second(s), 56 queries .

回顶部