QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>9 v8 B" b0 p* I2 ^
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
5 \& F: g3 R' g9 i使用方法很简单:
1 H8 K; ~: m: ftest.asp </P>
7 ?" \5 A4 o% C<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
' C- [0 J. }1 c5 \8 L& l&lt;% 3 u0 f7 {' [. j1 ]; P8 k  Q  e
output="XXXX"
% B1 S% N) x" Q! z( `9 JSet debugstr = New debuggingConsole $ V( v1 D0 _' S% t7 ^
debugstr.Enabled = true , S( x: |: \( _; U- n: ^+ T  O
   debugstr.Print "参数output的值", output
0 J, v4 v- Z. M" n* V, G! V8 I   '…… 7 C5 q+ d/ ?3 p6 {9 x) a
   debugstr.draw
2 a0 |" e) Y1 [% b3 M8 r9 W1 rSet debugstr = Nothing
+ [" P/ y; u% S& v%&gt; </P>1 r) M9 l3 b! Y
<>=================================================== </P>
) ~6 m6 c/ w3 S! U<>debuggingConsole.asp </P>
: O, i/ @- p) X; b, E<>&lt;%
- J: h. m; ?9 a% m$ e+ AClass debuggingConsole </P>
% d8 ?0 U" U' ^2 i" c9 ^9 r: S<>   private dbg_Enabled
$ d3 T8 O- _+ R) |- x" q   private dbg_Show
# f- B& l2 ^% t6 A1 F# d   private dbg_RequestTime
3 [4 z& _6 K9 d- p# v- D   private dbg_FinishTime
( p. c* l7 o9 ]5 E  `) C, X! k   private dbg_Data ) r& L- U  W% K. p& K. D- q+ j
   private dbg_DB_Data 0 W2 H$ _" ^2 c# \
   private dbg_AllVars
) Q- N4 K9 ?% w+ X+ @" v+ m7 d. U$ S   private dbg_Show_default
% J% O6 X* V+ s+ Q4 u+ R6 u   private DivSets(2) 3 U/ N# v5 g# t$ I! w4 _
   
: z2 j" q$ O2 |5 T! n" S'Construktor =&gt; set the default values 7 |, D, Y& b, h3 D% P( }* \
Private Sub Class_Initialize()
8 Y# `; _/ a4 H" V. p4 \   dbg_RequestTime = Now() 5 f6 u7 W' G$ ]
   dbg_AllVars = false 4 W  P. n( \3 f5 T4 M- n9 f
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
$ H+ i( x5 ]5 r* b3 J7 I* z4 O<>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>
( v5 \* _3 R2 E<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
" W1 i* @5 h& l+ |8 M5 {&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>
* a" z3 b7 M$ F4 j& M; S( t<>   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>
# R' E- ^  e( I) {<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 4 |( m7 s" t0 j1 D6 a1 ]- D5 h( u
End Sub </P>! _( |# q* o9 w, t
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ! c$ g1 t5 h) i* d* [5 M
   dbg_Enabled = bNewValue - h3 o" O7 }! P6 b- R8 i
End Property </P>
$ @" j  w7 `; Y, L* T% x0 Y<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ) X* O2 ]5 [0 t; D9 [; S
   Enabled = dbg_Enabled
' b2 g' ^8 C/ V; E7 Z9 T0 j& T' E! pEnd Property </P>* w' N1 N! y* R/ A
<>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 " X: n8 {5 q% g. V- `9 E- f7 M
   dbg_Show = bNewValue 3 J5 e5 h/ y; R) K
End Property </P>
# y4 A! K, s1 n/ q# s) k* R9 D<>ublic Property Get Show ''[string] Gets the debugging panel.
! S2 `5 _1 }- r   Show = dbg_Show
6 _- N4 V& z3 N) r) p0 [  j9 X3 FEnd Property </P>
% C  a$ y. {3 [  W5 X$ g<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
$ e1 e9 |( `" b, Q: S, V% Z6 Q   dbg_AllVars = bNewValue
! ?2 t% ~7 d( F& KEnd Property </P>
6 |1 ?" @" w& U. l/ f<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 9 B; K$ _3 O+ K
   AllVars = dbg_AllVars
% F4 s1 s/ ~) r! lEnd Property </P># F- o* w; L. j1 v4 L# `) c
<>'***********************************************************   f! e. u5 W% \, E2 }
''@SDESCRIPTION: Adds a variable to the debug-informations.
2 N6 t' e3 _" E" i''@PARAM:  - label [string]: Description of the variable
5 Q  c+ s4 I% u% z''@PARAM:  - output [variable]: The variable itself / K. {5 Z& d' H, N
'*********************************************************** 1 ]9 k6 l. H- _% L  h5 w3 [
Public Sub Print(label, output)
( t' t- }" H- b8 u) Z% e6 h   If dbg_Enabled Then
; ~' Q3 ~6 D% Y     if err.number &gt; 0 then
2 ~6 L; Y3 P  p% J: X9 A: v       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
1 ^( m, O4 y4 R4 d# a5 Z( D       err.Clear
* Q8 O- `( X' M0 T     else
* V% P5 y/ b4 ^( E2 f. q       uniqueID = ValidLabel(label)
" w7 f' r7 D  F! _& k# V       response.write uniqueID
+ Z+ }/ |$ w9 t7 f, t% r' a8 K       call dbg_Data.Add(uniqueID, output) ! f5 x8 G$ W" x
     end if " Q, h' j8 ?, r4 k( Z+ U- E
   End If 9 L1 o$ A5 r7 Z& W
End Sub
' |, l: |1 m$ T9 S8 q% ~5 @; d7 b  
2 X' b) k/ _) t) u" t  T" |'***********************************************************
! z( X- S) W% G) [' B'* ValidLabel
8 _% v9 ^9 V. H7 s; P% g$ D'*********************************************************** 0 ]* k% E& q: ?( z4 m; z+ {: R
Private Function ValidLabel(byval label) 4 l  O. U, f4 s' L
   dim i, lbl 0 M) G. X3 x- T1 j; Y
   i = 0
7 h( `, x/ z( T' }   lbl = label 4 j$ k# c. d' q
   do ( L. ~% P- t5 V! H8 A9 Z
   if not dbg_Data.Exists(lbl) then exit do
! b6 }# A; [6 S   i = i + 1
, L' P8 a8 \  j3 H" X   lbl = label &amp; "(" &amp; i &amp; ")"
) x! {' q- I& k$ W  H   loop until i = i . B0 `9 I* A+ D" t6 W% J, w
  0 ?* U. ^2 Z2 B/ o. n1 j) [: b( e
   ValidLabel = lbl 8 s# \- _2 e: f6 g, J% y
End Function 3 ?' K( F% X  u  P) f0 t5 ]) l
  
; A& b6 @; `) |9 @+ \+ v  P'***********************************************************
: k, e! [7 ^; C& D3 E/ s+ z'* PrintCookiesInfo
5 N0 z* Y6 u' {'*********************************************************** , z4 K$ h2 L4 p4 H! D
Private Sub PrintCookiesInfo(byval DivSetNo)
: c9 g& S. w& H+ b9 m! l   dim tbl, cookie, key, tmp # p2 T" H7 I* x* L
   For Each cookie in Request.Cookies
2 z( A: e% }6 U! P; y/ C/ U   If Not Request.Cookies(cookie).HasKeys Then 2 S1 K6 `1 m8 `' {
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
( s4 N7 g; E' Z! F/ U   Else
, p2 T. U1 Y. z2 i1 W1 C& a% E9 n% N     For Each key in Request.Cookies(cookie) 2 }3 S6 h( e" _1 U5 a- A- W
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 7 W* U5 \: I3 D/ B' h1 b' ], k
Cookies(cookie)(key))   
8 ]( S: |, o) I7 G& t8 A3 @   Next
5 X7 G5 v7 a9 k7 _' F8 h   End If
% k% ?6 E' W% D4 _# B/ Q   Next </P>6 n" }3 S" K+ o
<>   tbl = MakeTable(tbl) : I+ |1 u; u2 K2 A0 t
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ' V2 T/ ^  [7 Y% _+ N& c
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
; `$ U5 a  J' o  u5 D9 w# q   Response.Write replace(tmp,"|", vbcrlf)
. W- k$ P# W5 E4 H3 Bend sub
: u8 c5 F3 w, J9 n7 C6 h$ v  
+ ~) Y9 H' D) k  U: F- J'***********************************************************
" X+ n7 I. k2 O& k'* PrintSummaryInfo " u7 J! C2 e' m& M
'*********************************************************** & C  v+ T) r' D6 ?
Private Sub PrintSummaryInfo(byval DivSetNo) 4 z+ A: S! E/ X
   dim tmp, tbl 4 j$ ^0 T* l! V; ?. ^$ G
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
9 p' ]6 j( {: }3 X) c- Z) v   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
+ D0 M$ m# R) F2 h$ r3 N   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
6 h* z: L" ]( }   tbl = AddRow(tbl, "Status Code",Response.Status)
* J* ~' C. c$ L1 p8 S% i  R   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
% H9 U6 q0 M/ p/ G& J   tbl = MakeTable(tbl)
0 A5 s8 U$ y, j3 L+ M   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) : V8 f/ v# D3 d. U( s3 E- f
   Response.Write replace(tmp,"|", vbcrlf) ) Y! }+ v9 @; R" h$ h1 `6 ^
End Sub </P>
5 {: w1 A. e( O  _<>'***********************************************************   i" A; ^( ~$ Q. `9 u' J$ m0 V+ [
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
( P. n  y" {* ]# B''@PARAM:  - oSQLDB [object]: connection-object
" m5 s6 M. `* r+ v7 e' h0 K'***********************************************************
, d( J$ V8 t( S- I/ D* PPublic Sub GrabDatabaseInfo(byval oSQLDB)
& a( V9 s' E& X* b7 f) M3 `   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
& O* ?9 U: P" w* Z' O; D# v+ z   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
! \: u9 u0 x" H2 f  ~; C   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")) & ~' ^3 P! l1 C& ~% z1 ^: u
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) , w: f5 w- [+ Q
End Sub <>'***********************************************************   ^2 w$ p4 f9 X0 L: Z
'* PrintDatabaseInfo
% W- p. I% ~! \# M2 a; X0 z8 p' O'*********************************************************** " j* o% C4 T$ n* |- M1 \( D
Private Sub PrintDatabaseInfo(byval DivSetNo) 1 F. y, J; ~9 I/ B* G
   dim tbl
/ A! n4 D2 h1 h8 l0 n$ A   tbl = MakeTable(dbg_DB_Data) & r7 ~/ a5 H# |  Z4 |' P
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 E3 \: g6 T- s3 I" K
   Response.Write replace(tbl,"|", vbcrlf) : L8 D- a4 _' K! k& R
End Sub </P><>'***********************************************************
& k' S. {; J0 \+ A5 j'* PrintCollection
- z0 i9 D$ m- E6 }9 G'*********************************************************** 8 `( o+ w9 l! j5 q: C  e% u
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# _# T7 ]8 m0 |# c  E3 Y   Dim vItem, tbl, Temp ! ~7 H4 D3 t% S7 s$ J) i+ P% G
   For Each vItem In Collection ( d! Y! j& c& t* k: `& o7 r  _, s7 Q
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then % y/ E6 E! a# I% R1 O% p# S
       tbl = AddRow(tbl, vItem, "{object}")
" t; i* e$ l# ~: p- A) A' P5 _     elseif isnull(Collection(vItem)) then $ x! i8 q2 ~$ i' c
       tbl = AddRow(tbl, vItem, "{null}")
. [- e) }. M  d5 j% s; c     elseif isarray(Collection(vItem)) then
1 M/ {. G4 j! _* S" r% [       tbl = AddRow(tbl, vItem, "{array}") , \# B& u1 r# q4 Z) |
     else
8 Z! ~4 O# @4 e5 [6 U; G* l! i  e       if dbg_AllVars then
/ l: u! S6 u* e1 l8 l       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
1 s# O; X" C3 I) l4 u; D     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then * I( A+ c3 }1 r! d6 x" [+ e
       if Collection(vItem) &lt;&gt; "" then
5 R5 _" g1 ?" Q8 [4 p: u       tbl = AddRow(tbl, vItem, server.HTML
4 E" N" {! z# E& N0 TEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
! i- s7 ]3 U- G7 F% T       else ' X8 Y1 r) X( u1 Y& k) s5 {, b
       tbl = AddRow(tbl, vItem, "...")
7 U& T' @2 N( j       end if ! P+ M  v; }5 i0 w" L  ]
     end if
6 U) [6 q. {( Q% c1 s   end if $ {5 K1 `) P  j) C0 M
   Next # a9 n( P, h& g8 L
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo   O5 c# W/ F" l7 e& |  x) x  K
   tbl = MakeTable(tbl) ! m4 U9 y+ J: k$ ~: h$ b: D0 i
   if Collection.count &lt;= 0 then DivSetNo =2 ( K3 u/ k" |+ C* C% r: \- W
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
+ v+ @( H' P7 R0 c& E7 @$ r     tbl = replace(tbl,"#sectname#",replace(Name," ","")) , j6 d! z; J4 ^( t. D/ _% e
     Response.Write replace(tbl,"|", vbcrlf)
' Z# _# ?. Z* e" w* y4 ?$ y. REnd Sub
& s, L5 }+ g  J3 D6 P& R) ?  
. D, F7 |5 Q! {0 n'*********************************************************** * k) x7 w1 s0 R( {
'* AddRow
- o# l$ i; q1 |9 Y' g* @'***********************************************************
9 v. Q3 w9 k( O8 f% c- FPrivate Function AddRow(byval t, byval var, byval val) 1 [. P0 m) z' X" D& }) B" ^/ ^
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 9 [, ^# d( G9 z0 ]
   AddRow = t ! c7 _9 ?* }2 [- J
End Function </P><>'*********************************************************** / A, M1 B" |9 }- h/ q, \
'* MakeTable & w$ h# q2 C. w7 ?3 O
'***********************************************************
, r8 u* @3 G4 q: @7 ~Private Function MakeTable(byval tdata)
7 v8 i0 k  v% T9 K0 F  s  ~0 u; G   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
) G1 N# N3 t' s4 D% ]& t  K0 `   MakeTable = tdata
9 }% }7 c7 U7 u! q3 _- _+ zEnd Function </P><>'***********************************************************
. u- r. |8 l/ R( ^7 _8 d''@SDESCRIPTION: Draws the Debug-panel
7 z$ A- i$ \" i# @* v, b( S$ H'***********************************************************
9 Y3 l: S" y/ \6 I9 m1 V4 a" bPublic Sub draw() ; r! ^. u. e& q! A' y' i, `
   If dbg_Enabled Then / C- x' g: M  v) l
     dbg_FinishTime = Now() 5 t3 n' W0 \9 z2 O1 _
  ; R" O5 J; y) k$ f; p
   Dim DivSet, x 0 J6 T" y6 f" B
   DivSet = split(dbg_Show_default,",")
& [6 V; u% ^( U& P1 c' t! z     dbg_Show = split(dbg_Show,",")
, z& c! i" A( O. i/ _% `, J* R: f  ) {- T- e' c- _
   For x = 0 to ubound(dbg_Show)
2 s  Y' h- A2 j4 ^) B* A     divSet(x) = dbg_Show(x)
$ k. l/ w- x2 P7 ^+ W6 v/ M   Next # g/ V" ^* V9 Y, V0 K/ ?3 l
  0 O4 ?% \  q( B4 J( Q  h5 Y, I2 c0 k
   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;"   G3 r' _3 A) G* @& R4 G
   Call PrintSummaryInfo(divSet(0))
% p' p% z1 W9 y5 D     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ) p9 ~+ f* b# p' ]  H* g& }
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- Q! `9 V+ T1 j+ L    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 4 L$ v# d& ?9 M' A1 F" R
    Call PrintCookiesInfo(divSet(4)) " O1 D, Y3 G' U$ K4 s- q9 T
    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)) - M" @* w4 n. ^. k" r, w
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 0 e) D5 m9 c4 y4 r4 @: H
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
  M9 Y) K- J5 {2 {    Call PrintDatabaseInfo(divSet(8))
- p8 p8 a$ Z3 }! }( V    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
8 G  ]" |6 I  A0 W    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ) H& O- {. ^5 V' a9 {! r5 P3 U) [2 {
    Response.Write "&lt;/Table&gt;" 1 j) H# M+ `( ^9 i
   End If 8 ]1 E2 v4 W9 f9 Q1 r" M- @
End Sub </P><>'Destructor 2 k$ |5 N# M4 G, {$ @4 e' N+ O
Private Sub Class_Terminate() ! S2 g: s) S/ z; c' D; C
   Set dbg_Data = Nothing 9 W1 S* }9 r) z+ o8 M
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
8 d' w2 }% B; p/ h' [CLASS debuggingConsole
* x2 D; G# K, DVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) `* i/ N/ ]! w0 T( `&amp;n( O8 w# L9 d5 D% S* J3 _
bsp;
* ]2 v# p: ?2 `% L1 @Property Get Enabled===[bool] Gets the "enabled" value $ I- i8 E% _) J/ k* s. ?  g& r
  
2 i" A- t" `3 L, a0 ^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
% ~4 c6 c6 `1 H. ?8 v  
8 ]3 m# R5 J) W" k) n. i; ^Property Get Show===[string] Gets the debugging panel. # c! z9 J3 ~1 U
  * r0 F3 |; f" |1 h! P: v
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><>--------------------------------------------------------------------------------
3 q6 x: p' k; B1 M& KPublic Methods </P><>public sub===Print (label, output) + t7 J; V( ?/ M8 C# _! Y: F4 N
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 3 D# \" i, X$ W# r; X5 b
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
& n$ p( t, u; {/ y. y   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 0 v! F' Y$ P' }: f% @" W% Y' g: b
Methods Detail
- o0 B; Y' B' w  U- k  
8 S, X( P- J+ P0 N( Ypublic sub===Print (label, output)
0 X) X& j! r# A$ }5 o* hParameters:  0 u% S# r4 W+ r6 Z" g6 I$ J& a
   - label [string]: Description of the variable
( A* A! v& U/ B. C   - output [variable]: The variable itself
1 b% Z- ]+ z' T/ ]9 d  8 j$ G) b2 J; n7 o6 x
public sub===GrabDatabaseInfo (byval oSQLDB)   j# R, f- ?% K% N+ Y* ]
Parameters:  " c' K( _8 t$ ~
   - 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-10 21:39 , Processed in 0.910590 second(s), 57 queries .

回顶部