QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>$ X8 A2 p6 W3 j: k
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! " }8 d" M7 M) ]
使用方法很简单:
5 @( s8 x4 }9 B% H, ntest.asp </P>! U+ a8 ^+ U6 F* R
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 7 ]  e4 A( O- a$ Z" `# l
&lt;% ' v* w, c  u$ o4 `9 J/ A
output="XXXX" . ]2 I0 l6 F: I" p/ Q' Q0 Q% T3 _2 O, q
Set debugstr = New debuggingConsole 2 J  B) g% r, w* e% |
debugstr.Enabled = true
1 x7 ~6 d& y+ g* J: o; h8 k   debugstr.Print "参数output的值", output
3 n# I8 |# g$ `4 o3 G* H0 _   '…… + _) L8 v, A5 Z! [) x
   debugstr.draw   ], n% V, }7 C2 U% O
Set debugstr = Nothing
0 o* u7 ]2 n4 a%&gt; </P>
3 z) K9 E- N6 t; e' f; {3 n<>=================================================== </P>
) o. S9 V$ }& O6 _<>debuggingConsole.asp </P>
/ R. {/ a" f  Q) x<>&lt;%
- ~$ T/ h; S" h9 f/ @2 e% {Class debuggingConsole </P>
$ a9 F' ~# O) A<>   private dbg_Enabled 7 f5 n* o. x. u6 m7 v
   private dbg_Show 3 h" @) H/ D# F- e- i. s
   private dbg_RequestTime % t0 w7 d8 \3 f( Y
   private dbg_FinishTime : ^7 e) Q9 A6 c4 e/ j& w1 P( p0 Z+ W
   private dbg_Data $ }, a, o* _9 E+ j8 M) o( D
   private dbg_DB_Data ) g8 @" ~  ?- r0 e+ ?
   private dbg_AllVars ( k7 F5 m/ T' ^1 h4 O) u8 ?
   private dbg_Show_default
9 g$ b* M: p- f   private DivSets(2)
( D$ u. ?# y% E9 e0 T$ s   5 ?5 _7 t* D  Z" ?( V9 V6 p
'Construktor =&gt; set the default values % D  Z" g% ]+ c2 O! i3 {
Private Sub Class_Initialize()
4 ~& G% }3 z  ^- e) j   dbg_RequestTime = Now()
# z: c1 n7 _- D3 G   dbg_AllVars = false 9 z) k7 N2 H: J. a0 ?
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
7 H+ J* i7 G) {$ q; X, S' b4 r2 a6 K9 T<>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% |. u2 C1 j0 D4 W
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;) [/ U0 p& Y- l) [# ^* y; C
&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>
. J1 t4 y, N/ l4 Z4 A: v2 M<>   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>
/ L( N. o# I( H3 Y" j: ~<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ( q. V* V% X1 F' G7 n
End Sub </P>: i; r2 ~8 e6 ~1 q
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false $ C5 ?5 Y4 ]" v. I, Q$ T% j0 @
   dbg_Enabled = bNewValue / g4 D2 R; S/ h9 X/ @
End Property </P>
  w. s% i7 H) j+ a& w5 I* N<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
- o& i1 U' @1 ~9 `   Enabled = dbg_Enabled
- J% V6 S) q4 D: T2 JEnd Property </P>
; P8 t$ @+ r, b0 J8 b& P' q& L8 {: O<>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
1 A8 I  Q$ o. J6 t& n   dbg_Show = bNewValue 8 M! {: [4 r4 ?. H
End Property </P>% R. F$ `; p  G2 U
<>ublic Property Get Show ''[string] Gets the debugging panel. % k7 G. [4 N8 K# }+ e- ~
   Show = dbg_Show ! |: |' s4 x$ `, n8 L
End Property </P>: R6 s3 N6 {( D  i& V- a; p$ y  p$ S
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
; ~9 H+ @: {) U$ g6 a5 ~   dbg_AllVars = bNewValue + z. U! ~4 t3 Q
End Property </P>
# g" Z3 H9 S) N/ T1 s& E<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
. d9 D5 T# P2 S9 T! k   AllVars = dbg_AllVars 5 m# z! B' W) p4 s5 ?% G
End Property </P>$ ~8 d, U/ }( \1 }) @1 y
<>'***********************************************************
2 O0 V. y. A5 M: O$ v# J1 C) X; {''@SDESCRIPTION: Adds a variable to the debug-informations.
+ B& O' w/ W7 o9 }/ L7 _''@PARAM:  - label [string]: Description of the variable
1 s* [4 ?/ H' u  F''@PARAM:  - output [variable]: The variable itself * F/ u% e) P% j0 b: G8 [) O
'*********************************************************** 2 D2 ]8 F7 r: r3 [4 l, u8 p8 E
Public Sub Print(label, output)
+ t5 v* c& ?2 U$ n# |) x; ^0 R# E   If dbg_Enabled Then ) S/ }) |7 `! F7 @8 x
     if err.number &gt; 0 then
+ r1 x  w% m, i( ~9 g+ W       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
' }0 t# X2 e) m6 j0 b8 w" A. t       err.Clear
; X' J7 }2 W& Q/ Y% q/ p$ ~- q& g     else $ V& A) x/ A5 P* S
       uniqueID = ValidLabel(label)
/ \% {6 r% `% U6 f+ |       response.write uniqueID 5 X6 t- [" I" `! P) W9 M4 j3 c" U! C
       call dbg_Data.Add(uniqueID, output) % u: m, \9 H2 ^1 Q$ l
     end if
7 Z+ Y' H6 q4 V* Z   End If ; P# {; b1 `! |! T5 Y; o
End Sub
- Z4 W  w2 A) e# `* [. b  
0 ^: r9 c( V! j/ R* p'***********************************************************
6 j. s4 M) W; N  U6 ~'* ValidLabel - Y; \6 R/ M8 c$ O! n
'***********************************************************
* l0 N4 j' m/ e5 X) H# Y# MPrivate Function ValidLabel(byval label) : i! p0 B, b3 C# R# u
   dim i, lbl ) i$ G! q$ K% s' z/ g( `% x5 R
   i = 0 5 s% E8 J% F; x
   lbl = label
8 k7 `& b$ R) i' K$ P7 g- d% `   do
/ n' [- G5 f6 K8 a0 a$ J9 k   if not dbg_Data.Exists(lbl) then exit do 2 Y3 B- z. U' f3 o
   i = i + 1
1 Z- Z' D( Y6 ^6 L   lbl = label &amp; "(" &amp; i &amp; ")" . O2 A. c6 P: T, y6 u. @) p
   loop until i = i
8 r8 K4 u- ]8 x4 P: A' N- A  
& |+ B$ j7 n. B   ValidLabel = lbl 8 [$ Y9 }: c: D
End Function ( c8 S2 k& p3 r/ f4 p
  2 {; E2 E& w* W" l9 `' U0 ~
'***********************************************************
% D9 `! K9 T8 G8 q'* PrintCookiesInfo
" ?/ d" F0 {% X/ [! Z. ~0 H( C'***********************************************************
! a" _% `# C1 G9 _; r# YPrivate Sub PrintCookiesInfo(byval DivSetNo)
& h3 A) U1 V& }1 D3 M7 b   dim tbl, cookie, key, tmp : E6 b5 s! `0 R- u- N3 w0 c- X9 a
   For Each cookie in Request.Cookies
% X: V1 J: w% X+ R   If Not Request.Cookies(cookie).HasKeys Then , H' t3 j' A( _+ W: C! d
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
/ k2 }3 \. j2 U0 y/ C/ [- x   Else 3 d  d) x3 W# H
     For Each key in Request.Cookies(cookie) 6 |0 R5 r' A6 n3 Y
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
7 R# P: n) H* W: BCookies(cookie)(key))   
2 ^2 e9 b5 i  V. t! v2 i   Next
$ J$ r: {5 K0 q/ o# B! Z0 W% V; q   End If / u  Q$ Y1 T, m1 ?8 q
   Next </P>9 p# `. x% E+ z) h( U2 K
<>   tbl = MakeTable(tbl)
: T  j# Y6 _6 h8 v   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 + @6 _/ ^- N6 I* K% A
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
* @0 I) A% `2 [0 m   Response.Write replace(tmp,"|", vbcrlf)
2 }; ]0 d! Y9 ~9 iend sub
( p5 w( ^. V. Z3 }0 O# @3 P  / i" M* h' w3 f6 b7 \; q
'***********************************************************
5 k! r5 e9 ~8 B! O'* PrintSummaryInfo , [; X0 i4 P8 A" ?  |. a1 c; L
'***********************************************************
% F! Z/ }/ y' Z& _1 EPrivate Sub PrintSummaryInfo(byval DivSetNo)
* Y, u' n# Y8 y" z   dim tmp, tbl
7 n' N) D9 E) h6 U' h% L6 T   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) & @1 W: H0 M7 g+ z8 g/ u$ z( y- f) z
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") . e0 s4 \' U# T! y7 R7 F: Z
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
! R: c( _1 A& W) N; h2 @   tbl = AddRow(tbl, "Status Code",Response.Status) 4 i# M' N; r3 g8 W
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 4 N% A) r* v) T0 u% |0 K; |. w
   tbl = MakeTable(tbl)
! p, W! {8 G5 [   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
& i* _8 ?3 b' y" d7 z0 {$ E   Response.Write replace(tmp,"|", vbcrlf)
% K0 ~6 u+ |5 }End Sub </P>0 `2 R9 Z2 |1 S2 ]+ o9 Q. t& k: N
<>'***********************************************************
3 d' ?& n/ f) ?9 `1 ?$ d+ r" y''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
' J% D, P/ z8 ~  G# ^''@PARAM:  - oSQLDB [object]: connection-object % H6 l1 c$ \& u' N; f# k. g
'*********************************************************** 1 |6 s1 a/ ?. @2 v( G
Public Sub GrabDatabaseInfo(byval oSQLDB)
' v# P: Z7 Q; B' R9 Z2 z   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
4 {! k& e- A. f- T/ _; j   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) / T/ |- z) y) C7 p& A! a
   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"))
1 X& F6 Z2 q+ g' K   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
9 F& X9 {) G) i2 B8 Q- LEnd Sub <>'*********************************************************** ; l5 {0 `+ h& f$ z4 _+ c5 c
'* PrintDatabaseInfo " G1 q: r: v5 h( z. }2 Y0 H! I( |) U8 p
'***********************************************************
/ ~) y2 ?. k' i2 V) HPrivate Sub PrintDatabaseInfo(byval DivSetNo) 7 f  v8 w3 P4 o$ Q' ^2 j% c- Q) K& R' r
   dim tbl 6 H- ^5 e$ e/ e; S
   tbl = MakeTable(dbg_DB_Data)
1 E1 Z$ b2 ^5 B% @   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ; N& f2 b$ p- G% e" N
   Response.Write replace(tbl,"|", vbcrlf) / @  |' D. b/ N4 N
End Sub </P><>'***********************************************************
5 Z% z. T% L% p) Y" W4 w5 B% W'* PrintCollection 6 h' b' ^2 P7 k( L
'*********************************************************** ' g' {/ {) l# B+ o; P
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
, _% d# g0 v1 W* R   Dim vItem, tbl, Temp 5 O9 H; ?" q4 [% {/ a6 Z$ g6 q( A* e
   For Each vItem In Collection 0 N8 j2 H. [& E  c/ f* i6 p7 E; l
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
( N& N+ J0 N  l       tbl = AddRow(tbl, vItem, "{object}") 4 F# z  C. U3 M" `" m  x" S
     elseif isnull(Collection(vItem)) then 4 l: v$ n( R$ a  @. b
       tbl = AddRow(tbl, vItem, "{null}") / D) f  F4 r- D  _+ r$ y+ h
     elseif isarray(Collection(vItem)) then
" Q6 F" i# i1 a       tbl = AddRow(tbl, vItem, "{array}")   b; D/ e- o# Z+ Q. Q' N
     else
- G( U6 P' c; ~- _       if dbg_AllVars then * \% U" u8 i, _; q; x! t
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
3 N1 \: o' R& k     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 3 f" n& o0 b/ e! S3 C
       if Collection(vItem) &lt;&gt; "" then $ O  A) Y5 c9 D$ T* E( l
       tbl = AddRow(tbl, vItem, server.HTML
' h1 W1 v5 N: AEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 9 m4 Q7 A4 S* V/ |; l
       else
8 E$ K6 e$ C/ \2 n1 Y9 }       tbl = AddRow(tbl, vItem, "...") & G! |& h' i. ~
       end if
8 E. F; l9 h5 y     end if % @' p4 M* q* n+ s% O
   end if 8 ]6 [" ^' Z5 k; \+ g
   Next
$ E' ]( i" Q2 y: S: _   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 3 n; ?8 X$ b0 l# Z4 V
   tbl = MakeTable(tbl) ! {+ u. l9 L& q
   if Collection.count &lt;= 0 then DivSetNo =2
% b8 a" y# K6 x1 W1 `; s     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
7 |; @; P' \* h( G4 {0 b/ C     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
1 E9 t7 m% D" P1 A     Response.Write replace(tbl,"|", vbcrlf)   O2 j* E, A+ |) h; n+ E( B
End Sub
2 O3 C1 x, f. V. T  
9 M* w7 h$ L- z: P2 [! r'***********************************************************
3 _! h; B2 K" c1 r  t'* AddRow
) i" c5 H' d% Z1 P'*********************************************************** : r% H& d- }4 E1 q
Private Function AddRow(byval t, byval var, byval val) 3 O+ X" y2 W) D: g/ _* v8 \7 t% X
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"   m+ {) G4 c: F) L: K8 |
   AddRow = t ( x. X0 q* }" [
End Function </P><>'***********************************************************
; ~+ q. i. E0 L  m! E: p2 t'* MakeTable 1 ^! y9 ^; {/ Z# R% Y
'*********************************************************** ! z. s1 b7 h  y3 E2 F! q; j0 R  U  T2 k9 _$ j
Private Function MakeTable(byval tdata) ) m0 d; D  M. M5 y0 |# s) i
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 3 Q. t: W% N9 n: `4 F6 u
   MakeTable = tdata - R6 a* y3 S) @( U3 x
End Function </P><>'***********************************************************
# R/ A4 }: P! H6 z% j! Z''@SDESCRIPTION: Draws the Debug-panel
3 U" N! B" z/ D'***********************************************************
4 C$ E' Y$ R" k8 B! h! KPublic Sub draw()
3 a% p6 D8 c% a* o8 z* Q   If dbg_Enabled Then
6 m8 p4 ~6 V2 C0 A. Q, a; I     dbg_FinishTime = Now() % F) k* @# R6 O2 _4 O8 _
  
7 u5 ^8 Y! X& b5 {0 }4 J3 j$ X   Dim DivSet, x
# e9 d7 Z" Z0 n9 `8 W$ o: m. O3 m   DivSet = split(dbg_Show_default,",") , F  C/ r* I% P8 ^0 u' ?0 l
     dbg_Show = split(dbg_Show,",") ' W) j0 C( a, b7 U- Q6 [7 z# Y
  ! f0 f" o! v. J8 i: ?& B
   For x = 0 to ubound(dbg_Show) 4 s& ~6 u* S4 }! U
     divSet(x) = dbg_Show(x)
  P; N' b9 c6 s2 U$ w: f" w, V: J   Next
4 v, H9 u7 c- F5 v. i  
' |# K8 |1 G% b" K! z: T1 l; 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;" 8 D5 J! h% |3 [( R
   Call PrintSummaryInfo(divSet(0))
8 G7 a6 R3 R5 ~; m0 W6 `# m     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* k# j' m( f5 i2 M6 X    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") # |0 e! a6 W# e& W( V- a
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, _% |! l; R3 k0 X    Call PrintCookiesInfo(divSet(4))
& c! W; W7 }5 }$ k0 _    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)) % Y( _2 F2 l9 k6 w" M
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 8 e1 d2 \8 r8 B& J' f2 n
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ' h+ q- l) Y- Q5 Q) [
    Call PrintDatabaseInfo(divSet(8))
+ E& y% d& z2 z$ y    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : J: V. j" q# y+ p7 R% t) w
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) R4 v8 v) M/ Q; T: g    Response.Write "&lt;/Table&gt;"
% m. X& K4 ]1 ~4 T( P   End If ; j0 B& d. P4 o' W  T7 Z
End Sub </P><>'Destructor
& ^8 y3 ?: H# ^) |9 C+ nPrivate Sub Class_Terminate() 2 M3 P3 [( b  B
   Set dbg_Data = Nothing * Z  W! O) [8 h) m/ j9 ~& \
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
" a; B, O8 F7 M  g) qCLASS debuggingConsole # Y1 w$ b. \4 p% ^, K0 S
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) b5 ?. q" j) {& H* k&amp;n* Z/ a3 ?' V" C) t" y9 X! b
bsp; / k9 d7 U0 e  K+ n/ ?/ o( }7 D2 {
Property Get Enabled===[bool] Gets the "enabled" value
  A# C+ D6 ^  |& g  3 `9 d! n& [# F6 B  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
0 y% x2 L, N2 L  
& v, x# c0 D" g9 I- q4 K" pProperty Get Show===[string] Gets the debugging panel. " }1 m: W9 j; j% q5 n
  1 K' m1 R, {7 x, U( N% M% L9 Z9 L6 s
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><>--------------------------------------------------------------------------------
  U0 n1 T# j% bPublic Methods </P><>public sub===Print (label, output)
: X4 f) ?( H+ S' N2 ~/ ^   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
/ v% T( U: Q5 i& L" V   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () % Q4 x( g5 Y% H( z6 K* d  b9 ^
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- $ z, ~" O1 p4 S8 O% h6 A9 Y
Methods Detail ( O+ R7 M% ~* ^* L$ V7 s% E
  1 e1 k; ~' Z4 z3 ^2 ?* ]& F9 r
public sub===Print (label, output)
: y! @" i, ]* e7 Z2 h4 wParameters:  5 P- R6 q* p: P7 c
   - label [string]: Description of the variable
; K% E! i" ~7 o2 m# d. Q- U: \   - output [variable]: The variable itself & l+ P5 H  Z7 v
  2 [$ V" g2 s/ T$ h) ?
public sub===GrabDatabaseInfo (byval oSQLDB)
  [& x( D; e8 D# k  S9 C8 o/ bParameters:  
+ {, ?0 O% b5 u/ O8 ~+ B- k   - 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-18 07:40 , Processed in 1.121437 second(s), 56 queries .

回顶部