QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |正序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
& H8 R$ W& T$ B<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! # M8 t0 C' h0 t8 K+ `* O
使用方法很简单: 1 L1 v2 M2 O% r; `/ C) ]
test.asp </P>' V) P* S) U0 l2 x
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ; Q( I9 G! _1 g! y* K
&lt;% % q' ~$ a3 f. ^0 Z) z. ~
output="XXXX"
. P' v- L$ v3 g" z: i* |& ~Set debugstr = New debuggingConsole 4 l- i  q) _+ u* Q$ P
debugstr.Enabled = true $ m" O1 i; z0 L- P
   debugstr.Print "参数output的值", output ' G) w2 n- D5 C4 u
   '…… , r. ?8 }$ ?: T" K1 ^1 ]+ T7 o
   debugstr.draw 8 q& Z8 ]0 @" g$ e$ R
Set debugstr = Nothing
2 x* l$ {0 h( S7 Y; W, f! ^+ a%&gt; </P>
. ]! ^& ^- t" G% |2 f9 N* c% }+ e<>=================================================== </P>7 H9 k, p& T) f: p1 ]7 a! X
<>debuggingConsole.asp </P>
5 p# i8 }. U& R/ m<>&lt;%
- I! K' _# z3 }8 S, P* A0 _Class debuggingConsole </P>( n5 Z( f" A1 h
<>   private dbg_Enabled
" ?0 `: K3 K$ t   private dbg_Show ! c5 {' g6 T! @6 [
   private dbg_RequestTime ( w+ r! ?) h" l' P0 e& q. ~0 T1 ^( {
   private dbg_FinishTime 0 Q# u- ?/ \7 l, y6 f/ j& ]9 {
   private dbg_Data
& K9 ?4 A0 K; F( [0 ^3 |   private dbg_DB_Data ; B9 ?6 @0 t; M/ {
   private dbg_AllVars
* y" g8 K2 Q: g4 I9 L   private dbg_Show_default
! a; F5 Y# o9 @% @   private DivSets(2) + ?2 r+ H4 Z0 f4 H
   
% ^2 [( [) L0 q5 e9 |" w; i'Construktor =&gt; set the default values ! \5 K7 e  t1 W1 X* q" l
Private Sub Class_Initialize()
( K, c! S) n# c; {   dbg_RequestTime = Now() 0 X  ~' o9 c: F
   dbg_AllVars = false
: R. R% F$ o+ S   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P># i9 e% ^* o3 P- d, w
<>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>
% X7 _6 V. d* x0 u# [<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
! f& e" e, \6 w* ~$ w( 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>; o8 u! f0 ~  Y' n% G, ]2 ^  k
<>   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>
0 K( L8 p; U  O) Y% F  k7 L0 C<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" % i& c# ?  a5 o2 ?  Z3 I# a
End Sub </P>
; Z& y4 H' f1 O<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 5 R, J) u9 H# R9 I8 e" g" M+ q
   dbg_Enabled = bNewValue
2 J3 p6 r9 p5 T6 Q; pEnd Property </P>" q8 a1 ^$ ~5 }+ d
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 3 g$ G' N6 c! E( d) C
   Enabled = dbg_Enabled
& d; K+ v- i7 v. A6 fEnd Property </P>
4 A5 e, H0 _& u7 r2 L<>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
) W- ^2 A( S  k. [, Q   dbg_Show = bNewValue + ]& w- @1 U, D5 G0 D: i( n& ~
End Property </P>
8 D) Q' Z; f  R<>ublic Property Get Show ''[string] Gets the debugging panel. & M- }; {6 Y+ C2 {
   Show = dbg_Show - P( R2 S% q0 |" M
End Property </P>, W2 p0 P* A' \5 E! K4 O
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 4 Q6 S3 A% t$ p  K3 l
   dbg_AllVars = bNewValue
' V$ F# C" e: kEnd Property </P>
( r1 I5 ?) k. h7 h<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
& _) o1 i; ]& \# S4 y8 o# N   AllVars = dbg_AllVars - l5 @+ Y4 @8 y6 N! X
End Property </P>  U/ |4 W' c: a2 q
<>'*********************************************************** % O& Z; o7 }5 o% [2 |: a3 S! W3 L' ?
''@SDESCRIPTION: Adds a variable to the debug-informations. , @  Y, [) {% ?. M3 J; q
''@PARAM:  - label [string]: Description of the variable 1 y, g& |# c- w4 \
''@PARAM:  - output [variable]: The variable itself
7 a" g; R* X2 Q7 y2 ^% ]$ O, n5 k'***********************************************************   O! [$ G0 T/ ~$ q* S
Public Sub Print(label, output)
! `1 J; l& g: c* r' `) W8 n' R   If dbg_Enabled Then - e9 v% P( I9 h) S
     if err.number &gt; 0 then
" ]1 [' D, Q; B) K       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
+ |# p0 s# ]. W% l6 Y1 O       err.Clear
8 I, j$ x, O+ j; x- m% H     else
  y  g' h2 t- O/ J0 s       uniqueID = ValidLabel(label) 0 j) x+ T5 s. H9 f9 y: s
       response.write uniqueID
# W; `- ~9 W4 T, R; V  R. L       call dbg_Data.Add(uniqueID, output) 3 k( W( h  g4 ^4 l' f; i2 ~5 d
     end if , l0 K2 D* ~/ Y' ~* x6 L
   End If 7 [7 \) d3 i( I  b( J/ Z
End Sub 7 j8 K9 I- @  T+ Q2 u! }7 L
  ' N* g) Z7 h/ F4 I
'***********************************************************
* h; V& |. @* w, l'* ValidLabel : S6 C8 Z  r, j  X3 m, S- R
'***********************************************************
3 G- ^0 b" X4 r8 [4 F! F, U+ hPrivate Function ValidLabel(byval label) 5 {+ t2 J+ X- I7 w
   dim i, lbl 8 P5 f& Q3 I% s2 ~$ d
   i = 0 , y+ o' q$ P7 f
   lbl = label
3 [. ]& S2 c) \$ T   do - B  Y  W" D" F
   if not dbg_Data.Exists(lbl) then exit do 4 u3 w; C0 I) l- X
   i = i + 1 + D. X8 Y3 I; c% k7 {
   lbl = label &amp; "(" &amp; i &amp; ")" 8 i6 k: u4 [/ ]; \4 ]1 l, |
   loop until i = i % Y+ z9 ~- g' y" B/ R; u
  7 T- ?3 M: O& P
   ValidLabel = lbl 3 z8 `/ V7 y/ O7 k5 h7 h1 k& F. s9 z
End Function 1 z' g  Q/ H0 [; w- U  w+ ?. k% _
  
# {; O/ c5 R/ Z7 h) ~, p'*********************************************************** * c( t& v/ R+ k! s% K
'* PrintCookiesInfo 5 u  C! v0 U2 X: G: t$ ^) l. f/ m
'*********************************************************** " R4 Q$ [1 E  ^, n) j' f5 g
Private Sub PrintCookiesInfo(byval DivSetNo) 5 L" {' C" d: c7 n6 v6 d* C' U
   dim tbl, cookie, key, tmp
$ V' R% G7 D9 r8 ~& p   For Each cookie in Request.Cookies 3 |4 H* R5 Q# K
   If Not Request.Cookies(cookie).HasKeys Then . F$ s( K/ a9 N. V  w$ u0 e
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   5 |- U2 J0 r; r# p1 _& S8 O
   Else
$ `: W# ^1 A6 m5 \8 R8 p" k4 J3 z     For Each key in Request.Cookies(cookie) ' B4 {- |7 _2 R- I: q" M
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ( x& g. F% \" {
Cookies(cookie)(key))   3 d8 |$ t+ M& v2 y6 S: h. ?
   Next ) [! A% q; s2 `; M' K
   End If ' B+ p. u$ j! `$ k7 V" L3 B
   Next </P>
% w$ y# P# d% A! B9 L<>   tbl = MakeTable(tbl) : H' c% S& a1 \+ l
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
+ @& C% X4 X' g; V  R   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
  g4 ~0 _* x+ \' V7 u' W' f   Response.Write replace(tmp,"|", vbcrlf) ! G2 p1 H, C2 E4 ]8 {7 G$ }1 w0 p( a8 _
end sub 1 H9 N% H/ b& n2 R
  , O; J7 k6 h1 J& f! o
'*********************************************************** 7 y8 G3 m1 b+ K, L& g! [. e
'* PrintSummaryInfo - V4 z6 _2 L5 n+ ~
'*********************************************************** * r* H$ z4 A! D8 w  v6 d0 \
Private Sub PrintSummaryInfo(byval DivSetNo) 2 a2 [) ]& F1 _. c# s
   dim tmp, tbl 0 h: `3 L$ S, t; y, V
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)   m  l  g. L6 w
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") : N9 Q. _3 R* K$ d" @
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 3 d4 O: M# ]; [; B
   tbl = AddRow(tbl, "Status Code",Response.Status) $ r/ T5 \, i/ v9 S2 k3 h; y* ?
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
  z; m$ M* l: c) ^   tbl = MakeTable(tbl)
3 x; d/ Q% U, f# ?6 V$ k) S5 z8 B   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
# J3 n. M1 U8 A2 ?. `   Response.Write replace(tmp,"|", vbcrlf)
; t, c7 H- }9 t2 v7 `End Sub </P>
+ @& D& V* Q! A, {, H7 r( R' ~& T<>'*********************************************************** 7 H; ?1 S  l9 l. j* S; V. T: n
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
2 H  V& B( N6 L) q0 F4 }''@PARAM:  - oSQLDB [object]: connection-object $ L+ R. Z( Q% {! @) B+ d$ O
'***********************************************************
6 Q9 ]& i6 B6 {+ l- X8 KPublic Sub GrabDatabaseInfo(byval oSQLDB) 8 D6 _' L& i' B1 O" \9 p
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
$ y1 q4 b8 h6 R' p# ^1 m# ]   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
% |6 ]. ]2 [: }0 d$ Y" {0 G5 ]   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")) - s0 |5 ], M' @3 {- U, ^
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
/ g: T- ]- N$ ?) R/ s6 L& M4 uEnd Sub <>'*********************************************************** % t/ I6 C0 z3 B/ G" @$ z
'* PrintDatabaseInfo ) K( d! Z; j" k! A9 U
'***********************************************************
  I8 t8 B; T$ A4 B) V$ _Private Sub PrintDatabaseInfo(byval DivSetNo)
5 i8 }/ d! D: V( i9 u6 n% \( ~   dim tbl
0 k6 ?, K+ _1 C: d   tbl = MakeTable(dbg_DB_Data)
% K$ t: ?4 W& C% X, T) P' M  N   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ l: d6 U7 D' s3 e   Response.Write replace(tbl,"|", vbcrlf) ' X9 t" c2 M$ w; c. k
End Sub </P><>'***********************************************************
$ q. q0 u! }+ ]# ~5 S'* PrintCollection + e' Z% J* x/ O& {, P# s# K
'*********************************************************** : Y% e: S/ A2 O; p
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 e. r) O4 m5 ^) d% ]2 [   Dim vItem, tbl, Temp
( M. B. W, |( I   For Each vItem In Collection
! l0 }0 K. s( g% w+ ~     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ( |  h8 m& a, C' @# \' @0 X0 M* O
       tbl = AddRow(tbl, vItem, "{object}") , F3 q8 }. O5 E. @
     elseif isnull(Collection(vItem)) then
* H  w3 l" ]. N7 x% Z6 @       tbl = AddRow(tbl, vItem, "{null}")
7 p+ p: ]' G! f% ~3 X     elseif isarray(Collection(vItem)) then 1 T: [5 K5 Y7 M0 z, f
       tbl = AddRow(tbl, vItem, "{array}")
# f6 R) s! D5 R7 q0 Z) e( x- ^     else
. w- M! T5 ?: W3 P% k  g4 y       if dbg_AllVars then
, c, g3 x& H% ^& z       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
! E7 M5 E* q4 Z( l     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
5 ^$ ?5 l) ^: G2 _- r       if Collection(vItem) &lt;&gt; "" then $ s9 A6 n5 u* {7 _; N
       tbl = AddRow(tbl, vItem, server.HTML) C4 Y6 K4 q7 k3 y
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ( O/ Q9 e* S- a9 j, |( [& w8 V) x
       else / J1 P4 L' ~1 P+ f
       tbl = AddRow(tbl, vItem, "...") 8 f5 u0 X9 t3 P3 a% r+ d5 Q0 ^
       end if
4 a8 I  G0 ?# i: G& {0 Z     end if ) E9 F3 q% ~' n, E* I
   end if
# B. O! l" B* d, E3 Q* X   Next
# Z2 K. |3 }/ r/ r* |   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 2 N3 l7 ^. ~( s6 ~
   tbl = MakeTable(tbl) 1 y, L% A. {2 G9 i0 l9 S1 S
   if Collection.count &lt;= 0 then DivSetNo =2 4 s1 R. z/ Q: C7 X
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
/ k! B' C) N$ L  G) I     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
6 g# s% a0 N! y3 j" S7 }     Response.Write replace(tbl,"|", vbcrlf)
: N# q: a! P; q6 lEnd Sub
$ T6 O: X. Y! W% P' ^# c  ! f6 U, S7 ]$ p( J$ T& n; n% I$ ~
'*********************************************************** ) T) [6 {4 O- ~% f4 u
'* AddRow
5 }9 _( U. U) `/ R0 k'*********************************************************** % S) t- B6 `. e
Private Function AddRow(byval t, byval var, byval val)
5 v$ K0 ~9 y; U* R0 [   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
* ^$ K9 Z$ t9 R( ?   AddRow = t 6 h/ j/ Q; r! A" {6 U
End Function </P><>'*********************************************************** " T2 y9 W6 h8 b1 F: m0 |
'* MakeTable ' t+ V( N0 }" z6 U8 m
'*********************************************************** ' y; V) _& m' ?, j. d0 q% p, }
Private Function MakeTable(byval tdata) " O7 L. h# R) j( h0 q5 F
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
3 @3 X! J3 l  k9 l! l' [5 L8 f( ?   MakeTable = tdata 9 e, [  A3 ]' F1 J- @
End Function </P><>'***********************************************************
; ]& e1 R; L8 n3 _# A( A, n''@SDESCRIPTION: Draws the Debug-panel ( B0 f+ s& z& \
'*********************************************************** ) [; q0 j, T' L. d! H' E
Public Sub draw()
& v, }" {; |& D9 [/ c- m! q   If dbg_Enabled Then 1 g3 ?$ B% Y( O  r. g
     dbg_FinishTime = Now()
7 V5 B3 p5 [0 [; |, w  J  0 G3 s/ {- V* B2 L; B$ \
   Dim DivSet, x
+ w  G% l8 d; [( G  H- A   DivSet = split(dbg_Show_default,",")
" Y0 b8 U  {/ A3 @3 F& G     dbg_Show = split(dbg_Show,",")
" z# v7 o9 s4 y, x) `, B; d7 {  2 j0 d3 j6 Y/ r. E1 X) r) o
   For x = 0 to ubound(dbg_Show) 0 @- f! y& o! y# y2 M% ^9 }6 {
     divSet(x) = dbg_Show(x) - b6 ~7 @+ q2 {7 E3 q9 B4 l2 E
   Next   D3 M& V. l2 ?! w
  
% }9 h8 l' ]- i   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;" . f' @. v7 y6 q* {% a
   Call PrintSummaryInfo(divSet(0)) 1 d/ r( P+ N* q, R
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 }8 `' \( C, A* _5 q
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 @1 Z" r! \9 H, o1 O2 v
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
; t* \( I: r! u  S; C    Call PrintCookiesInfo(divSet(4))
0 ~- ^5 n% z" b1 f5 w/ m    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))
* ]2 m- W; ?  y    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ( c& u! p0 o: f" T' r1 e; J, k
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . ^9 `  h) u' W/ d
    Call PrintDatabaseInfo(divSet(8)) " r( I7 h  R) A2 T$ ]- c: Z" D
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
" g+ j; r9 h1 z5 o8 w) i& J    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")   b* f1 I8 V% T2 x% `
    Response.Write "&lt;/Table&gt;"
+ c& B( c  ?' L: R5 O$ k( m   End If ) ~2 H  q' `) G0 ]% j/ Q& Q
End Sub </P><>'Destructor 5 U7 M, |* m8 X/ c+ f
Private Sub Class_Terminate()
0 Q4 b! ~) k% Z4 G7 S   Set dbg_Data = Nothing
* f8 V+ y( N; Y# \" v& i, m/ _) OEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
4 k, N9 a; j* P" h, E- z& H: v& H  JCLASS debuggingConsole
9 M7 C$ d. M9 L0 ^( V; d' U4 p) D1 BVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' d- R+ g6 W+ O5 O' q- d&amp;n
! I7 ]# m# N# a- w  y* Cbsp; & j. k) q* _9 Q& A2 g& a
Property Get Enabled===[bool] Gets the "enabled" value
% |* Z$ [/ q# `  
- ^' h; G) N; P( o$ I2 U: e1 wProperty 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 6 F% `" o# s: q9 Y4 F
  ' Z5 c  M1 M; V: I% U% I
Property Get Show===[string] Gets the debugging panel. - }6 O8 d3 y; U9 Y: p8 X
  
# Q' L1 G- |5 ~, l/ rProperty 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 d3 q6 Z- @/ }6 o
Public Methods </P><>public sub===Print (label, output)
/ B; [( d& A) ^+ ]   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
6 N1 L, M9 \- R* a! a3 a   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () , P; {( q* a4 f0 B. u
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- - `+ H( Q6 {+ o* s* C! M
Methods Detail % O, B* U+ S% W: P& I
  : o' n( a1 M( W6 @4 p
public sub===Print (label, output) * d) }# B+ z/ C& G' U; s
Parameters:  
5 j; s9 a+ r9 [7 v' b   - label [string]: Description of the variable
' l( B) c/ g, K4 B: g1 w   - output [variable]: The variable itself
2 |$ p- U! \; ^3 n  : x- H1 L% T1 w$ G! Z$ L
public sub===GrabDatabaseInfo (byval oSQLDB) # N# G: n0 e- g% p0 |6 s2 Z& \
Parameters:  
' J, k4 U1 v) D$ o; c( M   - 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 02:42 , Processed in 0.441333 second(s), 58 queries .

回顶部