QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
" f6 i; ~4 x! Q, w* t; w<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( v( j. r0 s( ?; Q/ Y. m& a- v
使用方法很简单:
- j& d6 g7 g% D, t- Rtest.asp </P>
& _" N& b5 ]* @7 ^2 E) k<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
' N. d0 z4 B# P+ o&lt;%
8 x# c% @& U) H/ t+ coutput="XXXX" 6 F- R6 a0 \2 v" w  v. x3 ]
Set debugstr = New debuggingConsole
; q. T- w5 @% q1 ?! y) h- mdebugstr.Enabled = true
4 o4 T- n( M. ?& x   debugstr.Print "参数output的值", output % M9 c" K4 R0 V. h# F* B" N$ o* |
   '…… , H  w/ Z9 ]/ U4 I8 X; `8 ?& A
   debugstr.draw
, M9 P2 y9 v( c7 QSet debugstr = Nothing
; W5 X* Q9 j; a4 F' U' x7 J%&gt; </P>
8 J! O  [, `; S$ ~/ \<>=================================================== </P>' r: \7 u3 o( T
<>debuggingConsole.asp </P>3 E5 g' J; L" j/ a. s7 _
<>&lt;%
* k( P5 K$ P  M- zClass debuggingConsole </P>
4 i  Y7 q3 K. d/ N/ d<>   private dbg_Enabled
; D" s8 _- v$ X$ M- }3 Q   private dbg_Show
6 y+ B5 o7 @. U; k) [$ c: X+ X- _   private dbg_RequestTime
, J, m0 ^1 M  u' W* l. N2 H2 U   private dbg_FinishTime
2 I4 ^, f* ]9 u. i/ d4 v   private dbg_Data
# a8 O2 u7 W  ]  o! S8 k4 @   private dbg_DB_Data
+ K6 C  j. l! r5 Y$ P; w   private dbg_AllVars ! u& M6 N+ \- v4 }- }
   private dbg_Show_default 0 _/ A7 p# j6 j; D
   private DivSets(2)
0 N0 ~$ I9 M8 G" ?0 c. X" t  T   - r/ |  V9 ~& q+ s5 y, r
'Construktor =&gt; set the default values ! M: O# S  O* d  z8 Z" u( U# D. _9 o
Private Sub Class_Initialize() 7 a: J' \% {- y& v9 H6 [
   dbg_RequestTime = Now()
2 P1 k/ P* k5 p8 s& r) i& @   dbg_AllVars = false ! a5 ]  E+ F1 Q' d. ~1 N" n
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
. z% R4 L% S$ w4 e/ o# z4 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>' V- `' ^' A) K; P# @, s" {1 w4 n
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;+ l% \( C+ V9 O2 ]; D/ K* P* f
&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>! K' T4 O8 D; |0 m1 n8 }( D7 c# e
<>   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>1 K) s. c, ~; W- X1 o
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" : V+ [6 {( `, k+ G
End Sub </P>: [+ z% x0 s! G. g2 j/ I
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ; O1 T7 ~+ e) L. f' _
   dbg_Enabled = bNewValue
+ R2 x: _( k. j2 |/ r+ \: i" ~" ^+ o2 ]End Property </P>, Z1 {( ~( \. a$ ^2 g- ~" D" c
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 8 l! Y/ v' K! H4 o8 O6 Z2 v
   Enabled = dbg_Enabled . r6 k* |) D- D( T' ~2 y
End Property </P>
5 r8 ~: [, {1 p<>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 - Q5 p9 w' @6 @* I  r: e3 k
   dbg_Show = bNewValue
1 r8 k. X7 z1 x' tEnd Property </P>9 [  w" B% O% E
<>ublic Property Get Show ''[string] Gets the debugging panel.
+ d. Y4 q* |5 J8 x2 A   Show = dbg_Show " f# c7 Y6 x* K! s
End Property </P>. _0 S  j& I9 a! ^& O7 U- ]3 s& C
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
3 v) I/ e, T. o- I6 I% P   dbg_AllVars = bNewValue 1 M8 s7 X& ^, V1 `5 O
End Property </P>1 e' `" F* s1 u" b
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. " I% d0 N) ^" L$ K$ Z1 A
   AllVars = dbg_AllVars
5 _! e7 C& C9 q  GEnd Property </P>
6 y  D, P8 P  q# A. V8 S<>'***********************************************************
! a5 h$ a8 `0 y7 b+ k''@SDESCRIPTION: Adds a variable to the debug-informations. 4 b9 ?. I: w4 [" L+ X
''@PARAM:  - label [string]: Description of the variable   ?- h/ p* t8 k. |! D
''@PARAM:  - output [variable]: The variable itself
) D3 X0 z/ F7 n$ f* W0 P6 s'***********************************************************
! R" J# E8 w) T7 `; h* X- uPublic Sub Print(label, output) & c# k8 x( P' i1 B8 w" @
   If dbg_Enabled Then 2 |; {+ J* o6 F; Y
     if err.number &gt; 0 then
5 m2 l. u2 e2 y$ }, u; t       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
1 U$ F+ S* c7 a% Z7 E8 y       err.Clear
+ @  c( j% h" L  w     else
9 r$ V* f* x/ j4 `/ ~       uniqueID = ValidLabel(label)
; \" ]) k, A% w# j3 s0 V       response.write uniqueID 7 W7 p' M2 y0 g
       call dbg_Data.Add(uniqueID, output)
) z$ E4 A2 i' m     end if 9 q7 ^& V' h& k. e2 F* a+ p
   End If
; u( C, x9 O% ~; E- p8 l4 yEnd Sub
8 N& O  u( L- V4 b9 ?$ x  
4 H# @# L3 u! @- S'***********************************************************
+ [  X' t! ^) T1 h: L- ]'* ValidLabel
0 Z, @9 O$ t7 n* K3 u+ ~4 c- W6 s# }'*********************************************************** ! {4 o" C) B4 [% Z4 x
Private Function ValidLabel(byval label) 6 g& n: \" l* ~& Z/ P! ?% N( k' Z, F* Q
   dim i, lbl , r9 I  `8 P2 a! K
   i = 0
1 }( `2 p) Y" h; ~  m1 O   lbl = label % A* e3 Q1 W& J' g' S( K
   do
: k! g& g9 S) [! h; C& T) Z   if not dbg_Data.Exists(lbl) then exit do 2 X& c, e% @. ^% Y, E) A* n7 ]
   i = i + 1
! O: U$ J8 v% y( r2 H- m   lbl = label &amp; "(" &amp; i &amp; ")" 8 S4 a" }( {" e8 b: N+ ?: x
   loop until i = i
( E+ J+ z( \$ _$ G+ K" j  
- m# j- Q. W' b   ValidLabel = lbl ' ?) g6 P0 S' J* l7 z: T
End Function
3 {/ c+ h. s( h. }5 V. R0 e+ ~  
5 G% `6 [# m# |( ?' t'***********************************************************
7 C# _# k$ v: G8 N1 L+ ?0 f'* PrintCookiesInfo
9 z+ z0 p, H+ ]9 o% j9 R'***********************************************************
* R1 U+ v6 X* Z5 \- vPrivate Sub PrintCookiesInfo(byval DivSetNo) & u0 T5 T! o4 F
   dim tbl, cookie, key, tmp
% i0 y4 ?: W  ^! z8 O! F& v+ Z   For Each cookie in Request.Cookies
0 z; p0 y+ v* `. x! x   If Not Request.Cookies(cookie).HasKeys Then 9 e/ n& s& E( T2 t! {3 K
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
  P* u! w8 X( C7 G   Else
: W% `  |9 O- C# [9 b     For Each key in Request.Cookies(cookie) ; I2 [1 ?! @  L, C7 L- u0 f- V% l" [
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 2 m- _  r( [8 G( d$ z. N1 K
Cookies(cookie)(key))   . r7 R4 [! A6 }: y9 O/ F7 K
   Next ! E* e$ p$ C1 a3 s. g
   End If 6 l' }' k/ w  t$ B2 D: H
   Next </P>0 |! d: M: W& X$ e
<>   tbl = MakeTable(tbl) . b2 H- t) L8 S
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
9 E5 @7 @+ f5 W2 ~  V   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 4 Z7 g: E6 V5 {# x& i
   Response.Write replace(tmp,"|", vbcrlf) 8 w. u6 {- i6 ?4 |5 a8 Z
end sub   a/ j0 J8 L# p# y2 B
  
/ L: G7 s( \- o'***********************************************************
& s0 e- U. {% I9 C  |* |'* PrintSummaryInfo # l, C0 r2 c; n' G, S
'*********************************************************** , y( C, D* m5 T& S0 v# I- i
Private Sub PrintSummaryInfo(byval DivSetNo) 2 {2 M) H0 F, @9 {% Y! i! h7 \) }
   dim tmp, tbl
; o! [9 j* m+ e- H: P; |' W  b   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
! N5 Z8 Z1 _, B! m   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") , R7 J$ O& u, q
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
  N" Q, M; J( l, s  [   tbl = AddRow(tbl, "Status Code",Response.Status)
8 P8 n. [0 ~1 G  R+ Q/ r0 |   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
' P* y: R$ A% C5 |8 L9 l   tbl = MakeTable(tbl) 2 m5 K2 D& @( X5 K, Q
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
' a' `. M4 t- p   Response.Write replace(tmp,"|", vbcrlf)
% f% T9 \# v3 q4 f4 v0 EEnd Sub </P>
* J: i% ?3 `2 y) u<>'*********************************************************** ; Z6 s3 z% u& b: }! @( e6 `
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 7 A) A; g2 N: e0 O
''@PARAM:  - oSQLDB [object]: connection-object
8 x0 e) R& J% e6 q7 M2 m9 q'*********************************************************** : \2 e4 @, T6 M- h/ `: [# E& h
Public Sub GrabDatabaseInfo(byval oSQLDB) 0 j: R; G1 m) D  X' A1 o' a  i$ P
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) ; _1 r! S; l* L! l" _% m4 ]" q3 }- c
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 4 }1 t& L1 z  D8 t3 d
   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"))
  o& r( y; a8 s: W4 Y7 n   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) * B4 d" ?9 V5 p5 Y% R9 ?' S
End Sub <>'*********************************************************** % @6 }. f! {4 q) I9 B) d; \
'* PrintDatabaseInfo ( }2 d+ u- S  h9 z/ p0 k
'*********************************************************** 2 S0 I+ Z( y/ R) s) i& Q: f
Private Sub PrintDatabaseInfo(byval DivSetNo)
# Y) a4 V5 i+ \! G( A   dim tbl ) g$ [1 s' K; ~$ }5 f
   tbl = MakeTable(dbg_DB_Data)
1 x+ z+ ^$ W9 \, V1 o: g0 p   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 3 X2 _$ I" J8 }* [1 Q) f7 C) y
   Response.Write replace(tbl,"|", vbcrlf)
: T; z8 ^( \$ `% f6 OEnd Sub </P><>'*********************************************************** 4 g. Z8 ~, @+ \
'* PrintCollection ! x: N: T. B8 y  @! m
'*********************************************************** 0 D" V! A2 J6 P) P8 G; ^" U
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 a  I0 ^4 I& t   Dim vItem, tbl, Temp
7 x& V' t3 W( ~0 z4 m2 C- a   For Each vItem In Collection
4 c* A* \+ H* Z" l: n1 a& S     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then / f+ u# F3 O% j9 }
       tbl = AddRow(tbl, vItem, "{object}")
9 n5 v2 h0 i$ f" {     elseif isnull(Collection(vItem)) then
, ?# l4 h% D* x$ }* M       tbl = AddRow(tbl, vItem, "{null}")
. T6 M. Q0 s* A3 E     elseif isarray(Collection(vItem)) then
: k) L0 \4 Q  |% v       tbl = AddRow(tbl, vItem, "{array}")
; t% Z6 E4 f# t) A* f9 I# \$ Y  U$ T     else
- C2 y" s9 w7 G% C% s* R+ `- J       if dbg_AllVars then
8 [% B* U* T) v9 \  D- \) K       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) # y% }. M' D, P0 _% @" @
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
% K- u% Q; R' K# {       if Collection(vItem) &lt;&gt; "" then
" o# n% o9 C4 f, {( t       tbl = AddRow(tbl, vItem, server.HTML( S& ~' Z6 y9 s: U' T
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
. }" ^( p5 \1 }       else ( D0 x$ j( h+ o! ]3 ^' h. C- o
       tbl = AddRow(tbl, vItem, "...")
$ S* e" m5 n7 ]% F; }0 H( g- y       end if
' Y/ J9 @: n# [, _( M     end if
. T& P" W. n+ ?8 M   end if 9 ?4 `5 k9 E: O6 @1 {
   Next ; ~" z8 R* C- R# D7 i& f' q& Z& p
   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, p* Y! r, M0 Y
   tbl = MakeTable(tbl) " A- }  O5 ^) o3 J
   if Collection.count &lt;= 0 then DivSetNo =2
- i/ n$ m- y) z' y% |2 S/ ^     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 S. H: R/ H5 @- c. I1 K
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) + R9 c* _6 q( P3 `( P
     Response.Write replace(tbl,"|", vbcrlf)
4 T. i% X7 \1 c. x  {End Sub ( B6 i+ k: ?% E; L
  
" \" b; P1 A9 I  \- `: W- e'***********************************************************
7 _. A  r0 G0 S4 \'* AddRow " i) K6 s2 K( S, e0 @; v* j
'***********************************************************
/ e5 @3 \% }# q. ?4 i" W, U; f. L2 \Private Function AddRow(byval t, byval var, byval val)
4 k4 O! Z4 y. Y; b   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
: ^2 ^$ ?; Y- Z' _1 T  x# q   AddRow = t 4 q9 M6 O* b* X2 E% `
End Function </P><>'*********************************************************** # n* h9 N+ x  R: n
'* MakeTable 9 J% M* K* j: Z' h  f% J
'*********************************************************** 6 q4 s4 G) g1 G9 ^8 w& T
Private Function MakeTable(byval tdata) 3 G1 N3 K: |6 Y/ m  Q: x
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
7 K3 Q3 y/ k' }6 e" s+ v5 c   MakeTable = tdata
! S/ u: H5 b1 HEnd Function </P><>'***********************************************************
5 i: f, Q$ d5 z1 e0 j# M9 J: f, Q''@SDESCRIPTION: Draws the Debug-panel 5 T) P5 _/ r8 Z  \2 x5 U
'*********************************************************** ! {  [8 T+ ]- w# n3 N
Public Sub draw()
8 c6 X# E- V4 H: ~7 E6 o" F   If dbg_Enabled Then
6 C, y* @7 o( s0 m' }) g- n$ R     dbg_FinishTime = Now()
6 Z( Z7 o& b9 q8 k  ; S  c6 M& A8 F# O( S8 |0 u
   Dim DivSet, x . a( s# s: N3 O9 L! X; o
   DivSet = split(dbg_Show_default,",") 8 M0 O- Y' ~, q( r4 t4 ?
     dbg_Show = split(dbg_Show,",") 1 G# ?' T8 u' T- ^. e4 Y
  
7 [# i; n& p" C' s. b! j   For x = 0 to ubound(dbg_Show) 0 E) D& r( D$ S% c
     divSet(x) = dbg_Show(x) / v/ ?; E2 g2 ?
   Next
  L! e% G7 v( Z  
6 u- R* |! q4 c' c* 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;"
. z+ s4 @' S, W   Call PrintSummaryInfo(divSet(0)) 1 b" }- A; l; }# S! V* M; ?" C5 a
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") . x! _  |9 i  |
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") + a: T8 v! N4 f4 c3 {
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") / M3 K+ [& E" v. ^- J  T
    Call PrintCookiesInfo(divSet(4))
5 ^+ u7 D9 [- D# [! Z. |1 a. @    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)) * p3 X1 _, {# n! o* b. D- n
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 v" Q9 f7 ~( D) n/ w' [    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 o3 R$ f+ b3 {7 c- {# F1 p7 g    Call PrintDatabaseInfo(divSet(8))
+ A3 M) u- |- Q: V( P    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ( f. F/ A8 E8 e) v
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " p, ]: f4 |" u. o" e2 g# f' r
    Response.Write "&lt;/Table&gt;" / a* k6 q* o5 Q8 j2 c; T
   End If . Y  a# g# \1 d6 z# }
End Sub </P><>'Destructor ( {2 y6 y0 _3 Z* X. t% n. g5 ^
Private Sub Class_Terminate()
$ d5 J( L: {; l; L. }. b5 z0 |  p   Set dbg_Data = Nothing 4 S# Z/ _1 z4 C. l$ K4 S2 `, L
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>/ Q8 V3 o( y7 G" z4 E) y
CLASS debuggingConsole
" E5 d0 C* ~) ?Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 r0 m; p/ ?9 X: T& V* S2 i&amp;n/ D5 h9 K- U4 c) A
bsp; ' y$ F6 ~, K7 x5 N4 ~, N
Property Get Enabled===[bool] Gets the "enabled" value
4 E) b% o7 w1 @3 K1 j+ `  
8 ?! y& x  w% Y& a2 ~) x: t3 EProperty 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
- s4 f. I& k6 z  / |4 w  i5 V( [* x! n/ l5 I! s3 @
Property Get Show===[string] Gets the debugging panel. 8 `- {+ o- n1 e' m  f( _
  
: I/ e# @- m7 G! KProperty 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><>--------------------------------------------------------------------------------
/ `' w9 f  B( q/ [0 R0 P  i' IPublic Methods </P><>public sub===Print (label, output)
$ E: @6 v+ [! L6 J, F' L   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) # \6 D- \  U6 u' _- l# L* V
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
2 d! }- R) p( C  {4 [' N8 i2 T/ c   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
8 W" }  C3 x; n* T* WMethods Detail
/ G5 t* M5 y0 D: |6 A  
: X% s" U! L6 N$ o$ qpublic sub===Print (label, output) ) t1 W& c. T4 t( v* c
Parameters:  * o2 w/ S" `& z9 @
   - label [string]: Description of the variable
  U% V0 b$ r, e   - output [variable]: The variable itself $ ]: L) ~/ }0 y
  
" {3 U3 B8 F: @8 Tpublic sub===GrabDatabaseInfo (byval oSQLDB)
2 |) t  v' P2 j8 ], `* VParameters:  ; M3 u' O8 {' w( ~% l' b6 Y
   - oSQLDB [object]: connection-object</P>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册地址

fastpost qq
收缩
  • 电话咨询

  • 04714969085

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-11-18 09:01 , Processed in 1.247515 second(s), 56 queries .

回顶部