QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>2 ]3 [4 R- w: `7 Q4 k
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ; M8 b) c5 F( [- `2 Q
使用方法很简单:
, G* q3 |# O! ?4 s0 P% qtest.asp </P>. E+ ~8 j9 r5 o, s
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ; ?) `% B( R. V$ f- c, A/ s
&lt;%
: f$ x( \. O6 ^: G* E: T. `0 Loutput="XXXX"
' a# Y4 A1 |+ C/ s4 L+ ASet debugstr = New debuggingConsole
& p6 f: Z- Z$ A8 Pdebugstr.Enabled = true
4 t, F% H/ `( t4 z, H   debugstr.Print "参数output的值", output
* J' s: f& @0 \& X3 c   '……
8 W2 D! u4 m. Y* s' v0 g( N   debugstr.draw - }/ w+ t2 K4 N1 ~1 G
Set debugstr = Nothing ( @7 [5 @& t! O0 R4 k
%&gt; </P>
  B& h/ k! i% P; U+ Y<>=================================================== </P>
0 N  ?4 z1 Y2 i. U3 K! [<>debuggingConsole.asp </P>
3 D. c5 o9 o$ h2 Y, }, Y* Y<>&lt;%
% S: D* ]+ e" T# U' CClass debuggingConsole </P>  t1 f: a3 B' w6 h/ t
<>   private dbg_Enabled
5 X( ~- J$ X  k9 d& c" S   private dbg_Show 3 ~7 G9 g. j6 G9 @0 |5 g) M  j
   private dbg_RequestTime   G/ Z/ Y2 ~" m7 _& [
   private dbg_FinishTime 9 H6 m8 k9 m3 _- L- [& X! a) [& V
   private dbg_Data 0 t+ P# ]! x- X3 r
   private dbg_DB_Data 6 i- H% m. |  l' ~9 O- k
   private dbg_AllVars
% y3 s9 ]% z1 z   private dbg_Show_default
" h- L- E1 m1 {8 t, O   private DivSets(2) 3 ?9 h( k1 f' Z
   
, a. a9 `' `% z. r6 L8 a3 Y4 q'Construktor =&gt; set the default values ! C- E! q7 T" H4 [- \# p: Q% d
Private Sub Class_Initialize() $ z* [0 D$ E% Z% ~
   dbg_RequestTime = Now()
& i0 X  v9 ]9 ]) D   dbg_AllVars = false # r% ?' H* h$ f7 N# i/ l& D* D
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>! ~; N- W2 y& l% d0 [9 n1 M3 C
<>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>
, U7 E0 O# P) ?3 s. d& O% ~<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;& p6 X; c9 j2 d3 M" p: V
&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>
! f, F+ e, x+ i<>   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>
4 N. w; B9 \7 N% }: J<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 7 S! ~8 I4 g( J) H$ N
End Sub </P>
' o( v  g. c& L+ O* W<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
$ L+ W1 a! W8 I   dbg_Enabled = bNewValue ' z- q. q% E4 g. s0 m8 E5 b! i2 n
End Property </P>
6 E# B2 C5 M( h& N7 G+ W% Z<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
+ p1 O+ U" X. _( d: X1 P! ~   Enabled = dbg_Enabled
# Y/ G. h# |: r* i6 tEnd Property </P>
, U/ l  A, s, u" W9 I( @1 Q# j<>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 ; e/ L" k! Z0 S8 E
   dbg_Show = bNewValue 8 {3 r, q, b1 K; B  o
End Property </P>
8 W) l0 _0 X% R<>ublic Property Get Show ''[string] Gets the debugging panel.
2 I4 D9 ^: l+ F) O& Q5 C9 x   Show = dbg_Show ( E% ^) d/ H( n5 S5 {0 ]1 F
End Property </P>5 D. B; u/ w1 s& G& F
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 9 U5 A7 Z! n6 N0 K
   dbg_AllVars = bNewValue
+ Y% b& o2 g+ A2 n0 b* }End Property </P>+ x# o& z) P$ q; s- Z6 t
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
2 L% `  Y5 L% A/ n; {% H   AllVars = dbg_AllVars
" w1 b% ^0 `& {$ s3 \& l! MEnd Property </P>8 `+ h) K# j/ x1 w
<>'*********************************************************** " ~, l" e* g5 A$ r7 l) p3 ?9 y
''@SDESCRIPTION: Adds a variable to the debug-informations.
9 y% o& v) ]* E- r( o''@PARAM:  - label [string]: Description of the variable ! h# b# [1 Q6 G2 P; H: n2 W2 X% J
''@PARAM:  - output [variable]: The variable itself
' D2 s* ^) q* M  F2 U'***********************************************************
: r/ o- L4 f/ \Public Sub Print(label, output)
. P% w5 m8 e' |9 [1 ]; ~) v7 f4 Z   If dbg_Enabled Then
/ ~( L2 R  Q  I  O' V% Z: ^5 t. Q     if err.number &gt; 0 then   w* t4 ?% J& A. Z
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) $ a( n# j( K" l- n
       err.Clear
# X1 h+ q  ?$ w; ]& X6 g# p4 G/ u     else " d, g  [3 n7 r8 {9 w
       uniqueID = ValidLabel(label) # |4 S- F4 z1 H
       response.write uniqueID ! d# x) L% R, {! t! O* L
       call dbg_Data.Add(uniqueID, output)
% ?# J/ F1 M9 Q& s     end if
  T/ b* a& z* T' v8 [& L% [3 }   End If
0 b* q+ t% t5 P2 M. m. ]' p% CEnd Sub
; J' A# N& `- I  
; n  Y* _; N: i" x+ c8 N( h/ U'***********************************************************
; l* Q* q1 Y1 T'* ValidLabel ( m* x7 M' e0 R2 e! t% d9 }/ p
'*********************************************************** / {$ M' s) Q7 q$ ~: N5 V
Private Function ValidLabel(byval label) 9 Z) a- y3 `" |0 }5 I+ ^
   dim i, lbl
8 i2 l7 U5 B& T& G1 S- I2 S   i = 0
7 O0 u1 _: d; D, @* o' s1 Y3 z, j   lbl = label
) X& h9 H# R% ~+ c   do
4 R. F" C) K; l0 m' f   if not dbg_Data.Exists(lbl) then exit do
. h# W+ ]/ W! A7 w   i = i + 1
' z( S3 O; R; u* W5 H4 }9 I" F3 l% [   lbl = label &amp; "(" &amp; i &amp; ")"
& {9 J' H9 n. Q  ?4 O$ [   loop until i = i % S# |7 K7 K4 ~2 x% n
  2 J4 u/ ]3 E; m; H/ j6 D
   ValidLabel = lbl
# P8 v3 R8 y- {' ^" lEnd Function 9 ^7 V4 Q, d5 m
  8 Z. D; N: F/ [0 E7 Q+ V% i
'***********************************************************
3 [  |# n; G* f0 }/ E'* PrintCookiesInfo 8 y' ~& k' \4 a% ^
'*********************************************************** * F: d" S0 D- A- l/ f9 I0 G
Private Sub PrintCookiesInfo(byval DivSetNo)
7 g" V* n0 A2 o+ }6 q   dim tbl, cookie, key, tmp
5 e" v) |0 L3 ~# q   For Each cookie in Request.Cookies + E+ ~. G5 T5 S& Y  @( N/ A
   If Not Request.Cookies(cookie).HasKeys Then
. l3 Y) @( Y1 q& R     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
' w; a) g% b$ |$ ]% o  r- x   Else * F( R9 U- w  G, I; H+ p* y
     For Each key in Request.Cookies(cookie)
. L* |) a& a3 `8 }     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
% F7 w; ]3 q* X5 NCookies(cookie)(key))   
& ~* W/ j  u$ {   Next # P8 @$ Z$ d0 S* Z8 `$ n
   End If
% u1 ?# }  k$ G+ h3 x   Next </P>" N* k/ k7 [8 g6 d0 j2 x
<>   tbl = MakeTable(tbl) . B4 P  b& x7 o  _# ~3 \
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 & S- D: {, W+ H! J' E0 a# s
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 8 K8 P1 E2 F; D! P% ]4 s& a4 Y3 S
   Response.Write replace(tmp,"|", vbcrlf)
; S, q' B! N, [! v. q  Qend sub 3 P) R% J0 F% R; Y4 H7 R/ k
  
' H- S) M8 {6 k  W/ [; g5 n" e'***********************************************************
" Q# U% `$ ^; _- H& o/ l# Z# L8 k7 S'* PrintSummaryInfo - K- c+ j& I; v2 D
'*********************************************************** 9 m  u3 q$ H# B! z
Private Sub PrintSummaryInfo(byval DivSetNo) ; x* h- y& V: c! Z' \
   dim tmp, tbl 9 J& a1 n! p5 o9 n! m5 T' Q; z
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) % q% ]- i5 k$ }+ d5 O
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
" X7 Y" ~7 I% D1 P   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
+ H9 `5 c( B4 d% U% M& @, K# L   tbl = AddRow(tbl, "Status Code",Response.Status) 3 o# c/ y7 p, _& z+ K; |
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
1 ?0 [4 V2 l/ x, H! I   tbl = MakeTable(tbl)
+ q! [  B! N! @6 W6 [9 l$ Z   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 0 Y/ N* O! f, ?/ M  R
   Response.Write replace(tmp,"|", vbcrlf)
2 c; ^1 R6 n6 L$ h& e# ^End Sub </P>
; y1 R7 Q) o6 H; a( c8 p0 ~8 J<>'*********************************************************** : Q3 ~; b. t+ G3 M
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& Y0 u% J- h/ M, W7 |+ M' z4 b4 _''@PARAM:  - oSQLDB [object]: connection-object
! ?5 ?# b3 v& X- }1 ]. V'*********************************************************** - k4 h4 b8 G# a
Public Sub GrabDatabaseInfo(byval oSQLDB)
! \/ F9 J8 d) S4 i   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) / L0 ?9 B. H* k
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) - I) i0 l0 N" `3 ?( W6 [
   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"))
7 T; h$ a8 c% n! `5 H' v# @: R1 M   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 2 x5 u  H) g, G& \
End Sub <>'***********************************************************
* |' Y; @2 n. K  e" g, a9 V0 G: ^  W+ ~'* PrintDatabaseInfo
% N' {, V% [; C" O'*********************************************************** . t7 ~% p, p1 v/ y
Private Sub PrintDatabaseInfo(byval DivSetNo) 2 J4 ~5 H* I* S4 l2 p3 v
   dim tbl 0 {  p* ]8 n+ d4 H4 Q3 \1 ^
   tbl = MakeTable(dbg_DB_Data) 1 s$ y3 L# |, L+ [; C5 y. c
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
5 _, X0 w% e9 _4 e4 l5 P! K4 e' J   Response.Write replace(tbl,"|", vbcrlf)
3 t9 j7 }+ ]3 X  iEnd Sub </P><>'*********************************************************** 1 m* f7 T+ {" b9 ?
'* PrintCollection 6 ~; T3 P0 q, F1 L+ ^) u4 P8 E1 c
'***********************************************************
  N+ D) V# b" t) ]0 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 5 \0 ]- C! v7 E
   Dim vItem, tbl, Temp
9 i2 k- u8 K; g1 G( l. R   For Each vItem In Collection
8 H' ^9 M& x! N1 \( V% k7 K     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
8 A2 s9 O( u3 C. K/ I& s% p3 S- z1 N       tbl = AddRow(tbl, vItem, "{object}") 0 R( h9 k: A% R- ^. L) p5 O
     elseif isnull(Collection(vItem)) then " s2 E" f; ]' B- \6 ^+ L0 J- N
       tbl = AddRow(tbl, vItem, "{null}") * A3 f& i( J4 `" x5 y0 H/ h; M. G
     elseif isarray(Collection(vItem)) then
6 K2 {# K1 f9 q       tbl = AddRow(tbl, vItem, "{array}") 3 k. F: n" @+ W' e4 u5 P
     else
1 V; b' R7 H: l5 r8 g       if dbg_AllVars then
( X* U% k# Q. \, D       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) & b, ~2 n/ t7 l, b
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ) M2 M/ r6 |2 I  l
       if Collection(vItem) &lt;&gt; "" then
. z1 r. z8 @& J, `  Y* P: @       tbl = AddRow(tbl, vItem, server.HTML/ {9 ~* N3 V4 C2 j
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
; _: a$ A* o$ V7 T1 c) r9 V       else
6 `5 g# s! I+ A2 x9 ~       tbl = AddRow(tbl, vItem, "...")
7 \+ X  N3 m; ~; [% m2 ^# i5 N       end if & a( f8 E4 i( Q8 `) O
     end if / T6 O0 q9 X# r  T: |: Q
   end if
, B$ P  e8 G! |# X0 M- T   Next
! R+ J* D6 B  }/ n) `0 }0 |9 v   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo . {/ ^& A4 O$ G6 Y$ @: G# y
   tbl = MakeTable(tbl) ! s3 O  R0 s2 \' F+ l9 S
   if Collection.count &lt;= 0 then DivSetNo =2
" H2 b9 i5 l3 l% T: P     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# W: i5 ^& w, B4 b3 S) J. }( y% @1 ^, i     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ E0 G' F' D/ z7 n; H9 Y     Response.Write replace(tbl,"|", vbcrlf) - x8 I( d  v, q" l3 N) o
End Sub
# K% c+ h; N$ s8 s, b$ h: I. C  $ f% G- ?- y) |8 K
'***********************************************************
( V" h" \: @* Z  W9 S'* AddRow ( T+ l# f* n% d+ y' n0 H
'***********************************************************
5 d, {4 J- @, F. `9 R2 r' y: `Private Function AddRow(byval t, byval var, byval val) 4 L7 z/ t+ S3 @
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" % q6 c' l+ n  W2 P/ t, C6 {1 Y
   AddRow = t
: r9 e8 C; M& KEnd Function </P><>'***********************************************************
& o# r2 q$ A7 E7 i'* MakeTable % P, g6 F  \9 i. r% @+ [6 B& A
'***********************************************************
1 M& a0 M) M5 V/ SPrivate Function MakeTable(byval tdata)
4 K  X7 w8 O1 M" c9 u   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
* F& _1 h8 `9 k   MakeTable = tdata : ?1 m8 V! R! n1 k) T" D
End Function </P><>'***********************************************************
6 P7 ^0 d  ]: q/ F) E''@SDESCRIPTION: Draws the Debug-panel + g* f/ M' f7 ?: i  q7 t- I( e& G
'*********************************************************** 1 C& C* X; P$ C! r) [* U- B
Public Sub draw()
& y8 u- j3 V/ p1 P" d% Y   If dbg_Enabled Then
4 b! C" }' \4 {) A" n     dbg_FinishTime = Now() 3 U, g9 [1 M6 @6 C
  . [0 A, U5 g: `* G
   Dim DivSet, x
$ Q! _- @6 m1 O" J   DivSet = split(dbg_Show_default,",")
6 D5 N" \5 A: e4 M$ _     dbg_Show = split(dbg_Show,",") & U9 i; k3 E3 Z+ o! e( s6 p
  ) L4 ]! O6 h) r
   For x = 0 to ubound(dbg_Show)
/ ~+ Y: E, V& u% @     divSet(x) = dbg_Show(x) 0 R- {, g3 l6 Y9 {/ i& O
   Next + P- w) {1 Q; p; Y% j$ {' H: d$ D
  
0 J0 ~0 s0 E  v' [/ l1 A   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;"
9 I+ Y1 P$ O& _0 F1 R& P# o   Call PrintSummaryInfo(divSet(0)) . i" V0 t+ k4 I/ U0 k+ |
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") " O0 n' r3 t4 s* d
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ h0 f7 B2 c7 n# }9 N9 S" Z    Call PrintCollection("FORM", Request.Form(),divSet(3),"") ' y- X: ]# e8 k
    Call PrintCookiesInfo(divSet(4)) . K2 {4 F' C' ?  t% P3 C: ]( a5 `
    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))
7 _- H% @. |5 v) }6 w8 o    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 0 i1 e3 O2 E+ K
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
5 C3 E! b$ k; {& t    Call PrintDatabaseInfo(divSet(8))
1 f! @+ k  n: r# x9 a+ \    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
" M/ A0 Y3 H, J  {% Z. E7 q; }    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 z# S( w' e8 @: o
    Response.Write "&lt;/Table&gt;" $ k$ W* ]0 m7 x
   End If " I6 S) ^& h+ U8 A( U7 j7 Z$ Q
End Sub </P><>'Destructor
4 s1 U, x6 M2 w- m0 U3 YPrivate Sub Class_Terminate() 2 i4 Z$ U/ w9 _3 C+ c& }1 ~& I
   Set dbg_Data = Nothing 9 s# Q# B' O: Y* c. M
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
  y; h* f6 S/ g  W0 c+ C' I5 QCLASS debuggingConsole
0 U' G' a* t' ~' aVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ( h' ^% K1 X$ Y) w5 V7 b, M& h" R
&amp;n2 X9 I: C5 y5 h6 P$ _/ o
bsp;   V2 ]/ `2 {1 D' Q6 t4 @. w# F. L& q
Property Get Enabled===[bool] Gets the "enabled" value 5 V% Z2 ]6 f. t4 ^6 P3 c5 d
  
$ Y' O4 Q0 w% I" U) ~/ aProperty 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
' v% F/ b& S4 ]) i  ( Z3 |4 b! {& p+ i% K" f
Property Get Show===[string] Gets the debugging panel. , H# z' r; K- U# a( T2 q
  * I2 ~8 Z7 C4 A7 f5 b; c: i' b0 Q
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><>--------------------------------------------------------------------------------
- {1 f/ J0 T* V: h; m0 TPublic Methods </P><>public sub===Print (label, output) / ]- j, A  O$ w, U- c) c
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) $ _$ |: u) J. E+ J$ z
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
7 h, r7 s: C7 L) l   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- / ^* `9 ~# e. U$ W" j0 f8 E
Methods Detail 1 z! @- I% G6 d) H: q8 G5 A
  
. v+ l$ J% g$ x, }+ b1 `& q6 R) Cpublic sub===Print (label, output) & D& E5 o- \$ U! B* d/ e$ W
Parameters:  / ~0 }. o+ g; n0 j" W% Z
   - label [string]: Description of the variable
5 f+ a$ l. V& d   - output [variable]: The variable itself 0 u; }5 h  [# U& c* c
  
0 |/ N) h4 m* N3 Mpublic sub===GrabDatabaseInfo (byval oSQLDB)   Z. b: @5 B9 f0 A
Parameters:  1 |! s6 A( d) q0 M* \0 L
   - 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-4-14 18:57 , Processed in 0.460481 second(s), 57 queries .

回顶部