QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>4 p* e1 c/ D9 ^8 c1 V# @+ _" C
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 0 _0 e& d" j  N% v1 v" M: s
使用方法很简单:   v! W7 G; d' |4 N0 R
test.asp </P>
. X/ [3 [, k% Y8 A! ~0 s<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
7 m/ m$ m! F2 K0 F* z! R; |* E&lt;% 9 ?- }  ~& d1 Y
output="XXXX" 8 `4 X( Y- Q6 L7 H) {# O0 ?
Set debugstr = New debuggingConsole
8 l/ W- {$ z- ~, u! Rdebugstr.Enabled = true
! K) d- H* l1 L! d   debugstr.Print "参数output的值", output
$ v# I3 \- Q6 a3 `4 O3 J* C   '……
- i- ~& b! B& ?. L  }0 r/ U   debugstr.draw
' o# a+ a$ R% k( d1 u5 R) V$ _5 q0 BSet debugstr = Nothing - D( u, q7 }4 f1 e, }5 z
%&gt; </P>! b0 z- H2 M. Z9 F: q
<>=================================================== </P>
0 h/ t1 I$ M0 \5 R<>debuggingConsole.asp </P>& ?2 I2 \+ r$ s( ^+ Y
<>&lt;%
) g% `( q; D# @Class debuggingConsole </P>* @5 T  q& G' |- `
<>   private dbg_Enabled : i7 j) E2 ~, [" w
   private dbg_Show : o8 y% @" n( {# O9 r/ K
   private dbg_RequestTime
# j/ x; z! X3 y- v9 h   private dbg_FinishTime   u7 O( T9 T% V6 A7 Q/ `
   private dbg_Data ) A9 V5 H9 `" J9 V" c& {2 |
   private dbg_DB_Data 6 E' n. h( W# N' p+ J( B
   private dbg_AllVars
6 _* t" B9 j/ Y3 L- Z4 d; x. ?   private dbg_Show_default ; P) L# b; Y; h" q
   private DivSets(2)
8 y( a( h" O$ b8 D2 Z   
7 q6 P- v3 d( c0 _4 h'Construktor =&gt; set the default values & ]) P4 l  {( O
Private Sub Class_Initialize() ! ?5 w1 _7 d4 u0 z5 J& {! N6 {
   dbg_RequestTime = Now()
1 Y) Y' ~8 T% _; z; ^0 b   dbg_AllVars = false
8 m0 u9 I/ U: Y3 B- x/ {1 {  ?   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>. U- E1 N7 d/ F& |8 m; _
<>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>9 d4 q" m( K7 q# d- w$ _7 {
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;9 b( r) z+ z; q/ u  j  H, I" ^  p
&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>) Q' a' L7 K  L  a
<>   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 e6 ~: t0 Y0 E/ ~+ ^0 [; K6 O6 a+ I; [
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" , U0 H  G$ |& {; n
End Sub </P>$ ]5 v5 y, x  `- x
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false   O  a& {  ]$ w! y4 a1 D
   dbg_Enabled = bNewValue & K% @7 o# l3 g+ Q
End Property </P>7 I/ _8 t: {, t& h# s! j
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value % H" o) r& h! z# H# z, t
   Enabled = dbg_Enabled 9 B& g( C, K, ~  O# p* C) ]& m& c
End Property </P>
2 Z" K6 V, i6 X. X( O& c# y& k* y<>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
; @, Q1 c3 G5 G$ ?0 q1 O" A: n   dbg_Show = bNewValue 6 V0 {! f8 l. v; F6 s. K
End Property </P>
8 s0 G1 c; i% k' |8 W<>ublic Property Get Show ''[string] Gets the debugging panel. : ]: z% W; ~- m/ s4 y( H8 N
   Show = dbg_Show 2 G% w1 O; S5 c$ c; |& O) P" [! f
End Property </P>
: @2 w+ P: t. K" g0 ~, I0 K<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false * ^& i- V7 T$ c* i, V4 l& w
   dbg_AllVars = bNewValue   Y! p" _+ [& N2 f0 J
End Property </P>  F1 n9 n9 m9 h6 ~) }
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( D0 N8 {6 n3 M- K' \
   AllVars = dbg_AllVars
7 c! \* y7 |, R1 p( {End Property </P>
, q& E  O& w. Y$ c<>'*********************************************************** ( I0 b/ S  `; y0 _1 E
''@SDESCRIPTION: Adds a variable to the debug-informations. ) d) M1 T! n8 X# s) w3 s
''@PARAM:  - label [string]: Description of the variable ; c1 k0 _. [8 M6 A" R
''@PARAM:  - output [variable]: The variable itself / A; p: F! w9 h6 D  |: ^# n7 F0 y# Y
'*********************************************************** . A3 J5 O% B- @, w! l" `: P- L2 Y
Public Sub Print(label, output) ; f8 _! |0 |3 @6 U
   If dbg_Enabled Then . i7 A# h, v5 z5 c/ a& w* l8 Y
     if err.number &gt; 0 then ! u% H: V5 W3 j5 e' Q+ \$ U% o/ k
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
: g$ @' e/ K1 ~' a       err.Clear
; \0 W8 s  \7 y     else 8 b7 y) g: i) K' I6 H/ y7 Q
       uniqueID = ValidLabel(label)
% }# O, _% }* t. p& p       response.write uniqueID 6 p4 X! o, S7 r2 |8 O  @4 _  [; G% r
       call dbg_Data.Add(uniqueID, output) ' y! L8 r, X4 r# r! V4 L+ u
     end if
4 R9 z- w2 i" f9 `) y( w1 a   End If
# c  I; k6 F( b8 @0 n" OEnd Sub   n' b3 g5 G! l! h2 ^
  0 q, k! f2 L+ u5 P+ ~4 D
'*********************************************************** 8 m( i* a3 _; ^4 T7 ]5 I
'* ValidLabel
; N" O/ x+ A  m' V'***********************************************************
1 R  W+ r9 g* U( FPrivate Function ValidLabel(byval label)
: ]( M1 W, ?; v% P4 k# G/ @   dim i, lbl
+ k2 J# c/ N$ D/ N* B   i = 0 " u. @  X4 p; x7 ~
   lbl = label
) N* t$ X, v8 K   do
9 u4 g: `% E4 a/ \' F5 U   if not dbg_Data.Exists(lbl) then exit do ( S- w& d# ]3 t/ o: e
   i = i + 1
7 T8 k( M8 l! d8 g   lbl = label &amp; "(" &amp; i &amp; ")" 6 V+ R' T' d" ?. Y4 ^7 a7 J+ {3 i
   loop until i = i   @/ C0 s; F0 C
  % d5 X. [3 X4 ?  h1 K
   ValidLabel = lbl
8 S+ c! q" X6 p6 K6 w1 ZEnd Function
: o) B8 X8 f- Y: U6 o6 G$ @  
% M( V0 _2 W% F9 F6 V'*********************************************************** - E3 g- `7 ]# f8 }- c
'* PrintCookiesInfo
8 a$ K# W, m' B'***********************************************************
$ d$ W5 n2 w/ G: pPrivate Sub PrintCookiesInfo(byval DivSetNo)
, G% P4 _$ ~$ Z3 M% C; i   dim tbl, cookie, key, tmp
; l- c$ q5 W$ F! C   For Each cookie in Request.Cookies
9 t, @7 _  A- q   If Not Request.Cookies(cookie).HasKeys Then
% c+ p' w, c1 }     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ; X9 G' ?1 c. l
   Else ( B% M7 @& H( A, x, p% H3 M; C
     For Each key in Request.Cookies(cookie)
' S( n: w" u1 k7 A2 _. O. s8 ~     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. / C& j# |+ \7 b1 R1 K
Cookies(cookie)(key))   
9 U& {3 k: t, |9 C9 Z   Next
) R( _- n8 e- J; W8 }* L   End If
; p* D5 D1 N* J, x2 ^   Next </P>3 \: t, U; A3 u  y
<>   tbl = MakeTable(tbl)
: W$ G! w/ i3 o* Z   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 1 u5 s3 z. Y' G1 D# @4 n
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) + c# Z# L) l' P% ]8 }" y3 ]+ C
   Response.Write replace(tmp,"|", vbcrlf) * h2 E1 W# k# h/ N4 ]) J& M9 s$ ]
end sub
7 Z$ ?% @; M, z: X1 k# T' W  
8 ^. \& l( q7 P, B1 }'*********************************************************** % w4 X6 X. `( s; Z: M6 Y' q' k
'* PrintSummaryInfo & B( v$ C; m: m- q( f: f- m! g
'***********************************************************
, D/ I$ T/ t4 ^' P" s4 D& d! [Private Sub PrintSummaryInfo(byval DivSetNo) . ?& n8 n: }( }' y' W& n
   dim tmp, tbl , I, {1 u( l' s' x" }% a
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 8 T5 [  S& @8 j2 v- v& Q1 n
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
! V( ~+ B  m7 }0 A% d0 e   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 0 o) \' o. x8 f& m
   tbl = AddRow(tbl, "Status Code",Response.Status)
7 e& P" f" q1 e   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 9 x# x" p# P+ J) q2 C4 h
   tbl = MakeTable(tbl)
! \8 j5 F8 D/ O$ U4 H   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
/ p- }4 T) D, c6 K! P' ^   Response.Write replace(tmp,"|", vbcrlf) ) {% Z% O5 u* Y
End Sub </P>. R* `% k* b* B
<>'*********************************************************** / Z- K; X% k0 y7 i% D5 I, I+ x
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 5 H* R' |% A. k
''@PARAM:  - oSQLDB [object]: connection-object # e, r' S- ^" c  M, O
'*********************************************************** % @" Y; w9 C* q) \5 v
Public Sub GrabDatabaseInfo(byval oSQLDB) 0 a- ]4 f* X! ?6 U+ m! s" P
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
# [& e# |  i; ]% Z+ C6 E9 v0 s   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 9 i0 o8 b% X7 k8 N- h- E
   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"))
4 i# _7 T: k* Z( y6 K- }" D   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
6 R  x9 O/ q; p* }* e) jEnd Sub <>'***********************************************************
3 R" f) x/ B5 y7 u; c3 A* z1 [1 d'* PrintDatabaseInfo
. ?" I+ P: d4 u! G'*********************************************************** ! _( F: q+ p3 I. O0 L8 d9 X6 _
Private Sub PrintDatabaseInfo(byval DivSetNo)
1 R! j) I5 p) h7 L  M. t2 Q   dim tbl
+ f1 \6 P( U+ `+ C" r8 J: @7 Y& W   tbl = MakeTable(dbg_DB_Data)
  s8 R3 @& N( Q* Z; a8 T1 n   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 1 |/ h/ E  z, H4 X, d
   Response.Write replace(tbl,"|", vbcrlf) & J0 m9 ]: A. n0 l
End Sub </P><>'*********************************************************** 0 w* U+ p. F6 Z" ~
'* PrintCollection
$ x8 Q5 `4 u% ~. v8 N'***********************************************************
/ x6 @# E- t( C% I/ k! y$ j9 |Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ! r2 y$ ]6 q4 Z9 x3 a# L
   Dim vItem, tbl, Temp
; o/ ?  r& [$ @' O3 b9 [   For Each vItem In Collection $ Y9 Y& Z2 f- H1 d
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 1 Z, k8 V: |  D" |' M$ C) ^" s
       tbl = AddRow(tbl, vItem, "{object}")
+ z/ G3 C! a9 {  M, `# s' D5 ?2 W6 c     elseif isnull(Collection(vItem)) then 0 ?* }' x" z* ?6 z9 Y, K8 q
       tbl = AddRow(tbl, vItem, "{null}") ' H$ e3 @# w: f  p6 i+ Y
     elseif isarray(Collection(vItem)) then
* C* k9 u9 R8 d. ^* f+ M% k       tbl = AddRow(tbl, vItem, "{array}")
7 g+ m! N2 W+ {$ P1 [6 z     else 3 ^/ C+ o* j; W4 O& P0 N; Q
       if dbg_AllVars then - h% Z; Q4 N9 v$ O* F& f
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) & @3 [3 s8 Y5 q: h: t. v9 X
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
$ f- V. R3 a/ B" d. d2 w; f       if Collection(vItem) &lt;&gt; "" then
3 f0 w, x, e. C; X% f$ G       tbl = AddRow(tbl, vItem, server.HTML
8 F/ T1 G5 r8 K" [: D1 b8 U2 b% tEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
, G5 _* V" ]1 M       else ; b1 ]# _% O7 Z5 j8 B
       tbl = AddRow(tbl, vItem, "...") 5 C/ K) s! P6 T: a( l
       end if
, O7 V( C- R! V9 N; g     end if
3 Q9 w0 t) `( t8 Z* I8 \5 @6 s   end if / a& G& r6 L! u. d; L" A9 d. T
   Next
1 K; x3 O6 r; K$ 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
) d1 I) U, r: k) b   tbl = MakeTable(tbl)
, h' e* N. t7 k* A9 M2 i   if Collection.count &lt;= 0 then DivSetNo =2
& x  F0 N& X2 i     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
% h- E# R# O2 F0 x; ^6 t     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 @9 `) ~" k8 z, r2 l, C
     Response.Write replace(tbl,"|", vbcrlf) 1 U& Y! {; a7 D& M7 k, k; {; q
End Sub
/ `1 w& i0 }, S  
. d& [4 N! x  _'***********************************************************
+ D2 n+ }) N+ ^- X1 l5 B' @. |0 y" y'* AddRow ( V$ ~* b. g, F: C* B
'*********************************************************** * x4 j! Q* H: _/ f; @
Private Function AddRow(byval t, byval var, byval val)
; \* f- b8 c  d3 e   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" # E+ X- f+ u* l3 k; S
   AddRow = t 1 P( f& L' x5 |9 Q
End Function </P><>'*********************************************************** ! S1 K( K+ C+ G1 m
'* MakeTable
, P) y& k5 b5 E+ E  a) W* l'***********************************************************
! i' ]9 |7 V- P9 q9 Y' v+ UPrivate Function MakeTable(byval tdata)
  R3 x0 m4 w, }3 |( r   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ' x) I* E) ~+ K
   MakeTable = tdata
$ ^9 G, T+ m- i$ ~3 p1 C' `3 }; SEnd Function </P><>'*********************************************************** # Q1 Q" f8 ^. n, B: }' d1 D
''@SDESCRIPTION: Draws the Debug-panel 8 n$ i' k$ F. u1 e! }7 \
'***********************************************************
- g' U9 \$ @8 S9 i9 cPublic Sub draw() # ~# I2 s) g# b2 W' {
   If dbg_Enabled Then 5 O$ {$ r5 a" U( M+ S
     dbg_FinishTime = Now()
$ T5 Z# E7 n' T* H* B; g  
" D' d& p$ U3 ~) Q' G   Dim DivSet, x
3 Q' }2 D0 D3 X) @+ u$ l& ~   DivSet = split(dbg_Show_default,",") + P! A4 V3 ~% v$ ~! B; g5 T
     dbg_Show = split(dbg_Show,",") # s9 @+ F* G# n8 k
  
/ B  A9 R3 @: \; h   For x = 0 to ubound(dbg_Show) 2 M7 P4 x, z) C
     divSet(x) = dbg_Show(x)
2 B& j& l4 f6 p! [% `: [: r   Next 8 H2 i6 O# K1 j1 s
  $ }, {$ D6 Y: c# B6 s: ?7 z/ r
   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;"
6 P, Z: j& I3 `, O   Call PrintSummaryInfo(divSet(0)) ( G8 I8 B+ s- D' E, d  Z, H% q
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 6 h, K- J* Q: D/ d% @
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
3 D3 P/ i# `* I: N: n    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
# e7 D& C% d( J5 C2 {    Call PrintCookiesInfo(divSet(4))
, U, c2 A; H2 L, ^, i: i: |    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))
( {4 s1 E# P+ D0 d4 ?7 }    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 u4 d) ~" L- [! p6 X+ V# r& i    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
( I$ M  h" k6 W, F( r" |# M  o5 r% g" s    Call PrintDatabaseInfo(divSet(8)) , ]* e- h  F6 Z9 |; V" E7 G
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
; c* c( x3 x& Q# g. e7 n: H    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 7 |6 k: y1 R$ l2 V4 M; Q, F
    Response.Write "&lt;/Table&gt;" # ^9 |, Q; v( t$ ?' ^6 |1 Q
   End If - p3 a9 @3 F8 Q3 J
End Sub </P><>'Destructor
9 x; ]/ l# ]1 N+ D# hPrivate Sub Class_Terminate()
/ Z1 O7 g6 O$ N- f7 p- [   Set dbg_Data = Nothing : B0 G8 O4 H3 `7 m$ R: i
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>* U! `# `  x6 a7 _
CLASS debuggingConsole
- N; v0 x- R2 B- B" O! [Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
6 f; |% Q' q' P, `# v: L5 x% r&amp;n8 L) y: M/ j$ w9 \- q# @+ V0 ^
bsp; & i1 V/ g4 k% b( Z; J9 t/ N
Property Get Enabled===[bool] Gets the "enabled" value
2 W( A( r8 [5 [3 E& R2 X# n  
& o9 f$ C) w4 H# t& x5 W2 Z4 HProperty 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, D8 B7 W$ o. \  W' \7 q  5 l: n, x4 C) y7 {
Property Get Show===[string] Gets the debugging panel. * Y" q; N; C8 b1 ^/ R* h
  
& K+ X" O+ s/ A0 iProperty 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><>-------------------------------------------------------------------------------- 9 J4 L( \1 p/ U: c
Public Methods </P><>public sub===Print (label, output) 7 H/ R( _  e8 v
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)   g! g1 X6 ~) i& y
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
& ?: C3 C% ^# g$ Z4 t# E( V+ {3 B6 K   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
. {3 S& h. p* ?- K& [9 t" T6 AMethods Detail 1 o* g7 P# m  D/ _3 N
  4 d7 ]. s' v* @- W) M$ R- }8 V
public sub===Print (label, output) / s+ G/ [8 F! L% O# @9 O; m
Parameters:  1 B( I- D8 I# ?* S7 w% _. s$ ~- B
   - label [string]: Description of the variable ) {: l$ i! e3 @* g* S
   - output [variable]: The variable itself 5 A) l8 x# \3 V. ]
  
# Q0 k* o! ~! |0 U/ c( ~# jpublic sub===GrabDatabaseInfo (byval oSQLDB)
6 a* r" q+ ~: ]7 j7 _Parameters:  
$ }) u/ L% t$ t9 F* o5 D9 }- \/ C   - 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-5-12 06:39 , Processed in 0.614572 second(s), 57 queries .

回顶部