QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
( V" |7 I& w. c- s& ~7 E<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
6 d7 y, _( P% }. {# ^使用方法很简单: 6 \$ E4 J' |4 Q
test.asp </P>+ r0 }$ K0 i9 ^/ X; d6 M$ G
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;   `3 j; r2 G( y! G5 ]
&lt;% ! b2 a3 c! p9 ~3 C
output="XXXX"
  h- n8 n  x$ ?5 `* ~2 VSet debugstr = New debuggingConsole
+ i5 c2 a- x4 Bdebugstr.Enabled = true 9 Q3 ]4 p+ J, T! v8 I
   debugstr.Print "参数output的值", output
1 Z' `5 n4 \& H: M% M% S* S) G+ Y1 ?   '…… 4 V3 S  _4 o2 b4 _# Y% M
   debugstr.draw 1 z: L- m: t% z) n. T4 N3 F
Set debugstr = Nothing
9 p0 |$ W' M/ z% n3 s, [; J%&gt; </P>5 \; S* L1 x$ g0 H5 B6 G: p& i- j
<>=================================================== </P>
, M4 r! c) v# S1 j<>debuggingConsole.asp </P>
( X+ |$ t0 e/ W8 W5 }* T. r<>&lt;%
8 v0 J( v: F6 ^- P' l3 R8 {$ rClass debuggingConsole </P>* T% U2 l' _7 k9 x
<>   private dbg_Enabled ( }0 g9 P7 p: \9 }
   private dbg_Show % q1 P9 ?) w" l7 `8 k
   private dbg_RequestTime 0 |! Y- t' o" ?4 ^( Z: x( M
   private dbg_FinishTime
& l9 N2 Y9 Q: m   private dbg_Data + @7 F7 a( K# ?3 i5 c6 ~
   private dbg_DB_Data
* Y; B1 k, l7 d   private dbg_AllVars
( U) H% y- L4 G9 p5 m   private dbg_Show_default 3 u( z/ G- }! p
   private DivSets(2) 5 f) U3 n/ v5 e
   
9 j& a" o& S" e$ W5 x* |1 h0 q" `'Construktor =&gt; set the default values * x1 d* b& }5 @! S7 T  H
Private Sub Class_Initialize() ) Q- A- R; T& n* ]
   dbg_RequestTime = Now() 0 W* m; i2 Q5 a7 {. F
   dbg_AllVars = false
- h1 z% a9 \# ]/ R2 L) l) ], w   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>7 a4 |, Q: F  u; ~0 N: J) ~/ 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>, }) o4 y1 C# Y" h* J6 L5 B
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
* b" W% J! U) J6 {3 \; n. `, H: M&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>
9 C( ]" v- Y2 R+ h<>   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>
: M1 n9 z) P9 _) Y<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" , `& G9 E/ l; u( k9 v
End Sub </P>
9 I' c/ s2 k+ l/ q, W+ C<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
+ f6 {. C, |5 m  l0 ~& M8 B   dbg_Enabled = bNewValue
8 X8 ~3 b( B* uEnd Property </P>
( \' U" F% S" a# y<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 9 S" J& E$ H/ [: V
   Enabled = dbg_Enabled 2 l1 Q' U8 Z1 H2 d7 C# R8 ~% k
End Property </P>4 W7 t% b$ \2 _! `0 j1 r0 C3 Z/ q4 X- m
<>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
3 H; t9 Z, A$ j9 Y& p) \2 U  A/ C   dbg_Show = bNewValue
; P$ k9 j( ]6 X' Z9 JEnd Property </P>6 ^; v( p2 S" P* M
<>ublic Property Get Show ''[string] Gets the debugging panel.
; l$ M+ L" Y6 K; `   Show = dbg_Show
( f1 G2 c# l& J7 O" Y; WEnd Property </P>
1 |0 w5 u& x4 |: I/ B<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 3 h) e+ E: o' K: K
   dbg_AllVars = bNewValue , \' N4 q6 e. `& ]: {% s
End Property </P>
$ N; @3 A0 j0 x% x( b( F9 m<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
. b* z  _# `, _7 \   AllVars = dbg_AllVars / q# t1 N2 U3 r7 S3 d; z( m* r  N
End Property </P>
' [% R% i% R* q6 S; d: j<>'***********************************************************
* V: s) O5 A5 F6 ~: c''@SDESCRIPTION: Adds a variable to the debug-informations.   R; R1 D) |! _+ a# s$ z
''@PARAM:  - label [string]: Description of the variable 7 b5 P. L( L* N: P9 `: i2 P
''@PARAM:  - output [variable]: The variable itself
. p# R' O4 t* x7 ^# s'*********************************************************** " D3 ~; X) k+ X/ s# _) X2 C
Public Sub Print(label, output)
& ]# F8 D: \3 T7 \" g4 y   If dbg_Enabled Then : B" S$ {& x9 t& {" J
     if err.number &gt; 0 then : `, q# M9 m# P# M. S
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 0 M$ K0 e7 A1 _+ M
       err.Clear ' t7 d2 m, `, L! y6 o
     else $ `2 a- o' k2 W5 l- Z4 G
       uniqueID = ValidLabel(label)
2 ]  {; h! W* ~2 H       response.write uniqueID " ]% O" h/ n, M- ~
       call dbg_Data.Add(uniqueID, output)
" L5 I- S" B/ ?9 P: O     end if
$ V8 f3 q* T' I: F4 k( a0 {& D   End If ; a# A! ^& o) n" M1 a
End Sub
& w, a* c2 k: L/ r& D- b- n  
8 y3 }. I, |+ {'*********************************************************** . V! C" h3 B3 @/ Q" V( W3 S. u
'* ValidLabel 2 m2 z. c+ a7 X/ t8 ^3 ?
'*********************************************************** 6 x, g5 B/ F& H: z
Private Function ValidLabel(byval label)
" O9 F% h) L% V' a% q9 [   dim i, lbl $ u3 Y* }0 |) N' [' i+ f
   i = 0
' j2 z) ^% M( e3 i* t( {1 h   lbl = label + {, o1 V: }  Y
   do
+ b) r# B0 j1 W$ Z" h* d   if not dbg_Data.Exists(lbl) then exit do
$ Z: U( W9 n, V+ H   i = i + 1
) m8 r+ u, {. C/ ~: L  Q   lbl = label &amp; "(" &amp; i &amp; ")"
6 E7 s0 r5 b& c% |! L2 k! K& A   loop until i = i - A" Y. J6 h6 X+ w/ Y
  
: _2 H& U% {( {. M6 D   ValidLabel = lbl   p7 p) F# G; v3 V! ], z: x
End Function ( u3 f: E9 u9 T# g% s
  
. s  B9 z6 l6 W'*********************************************************** # @; d$ w1 ]7 R& G' I  D
'* PrintCookiesInfo 9 ^) z0 m3 [+ ^2 E: y
'*********************************************************** # o( X; j# q' M; P& `( t9 r/ R
Private Sub PrintCookiesInfo(byval DivSetNo) ' }0 B" o$ B' m
   dim tbl, cookie, key, tmp 9 i4 Y5 |; }' [7 M1 R) x% l
   For Each cookie in Request.Cookies / U0 z0 n( R3 o8 S
   If Not Request.Cookies(cookie).HasKeys Then " V, X. C8 b0 ?6 u6 v$ S
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ' n6 T+ r) m/ G( h3 o
   Else 4 z' Y& |' |1 p" S$ q  ]
     For Each key in Request.Cookies(cookie)
/ m; I" b% t8 ?* Z8 `, y+ J     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. $ u) I. C* L0 P# l4 c! ]
Cookies(cookie)(key))   ; |+ g  _1 |: m/ t5 p
   Next 3 w8 B3 ^) I) v- D# [/ j+ f
   End If
3 U) j! n; F9 ?# |   Next </P>+ G% j9 M, A) i1 d
<>   tbl = MakeTable(tbl) / n" l. ?8 p7 B* \
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 - G1 w8 h6 M" V  T  P/ s
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) $ k5 j7 o5 o' \6 b: H3 M
   Response.Write replace(tmp,"|", vbcrlf) : O" j& P* M' _) g- J
end sub
& i, J. S: ]9 F6 |  P  
6 V4 K) s! ~1 l! W. d: k5 ~+ ?'***********************************************************
3 `+ A' @: Z/ s8 n' k% `'* PrintSummaryInfo 6 j+ I8 l8 K, }* {; z1 I2 Y
'*********************************************************** $ v) ]. n3 S/ L; u7 c
Private Sub PrintSummaryInfo(byval DivSetNo)
+ ]2 m$ j( u& s+ y   dim tmp, tbl ! {$ O2 C* s1 F! H$ x
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
  w( R' A4 q* o: G5 n   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ) Q; @+ W$ B2 W- J
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 C6 ~% W% O% _* g; f   tbl = AddRow(tbl, "Status Code",Response.Status) 0 C6 g9 x, b+ C7 a
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
! d. z2 ]2 s% y1 f) Z2 O+ R3 f   tbl = MakeTable(tbl)
! z9 x2 L) u; s3 u# ^+ O   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ( s, w- h+ `$ u$ p  N0 H" n
   Response.Write replace(tmp,"|", vbcrlf)
7 b. B! z7 a4 V7 A3 ~; P. iEnd Sub </P>
! C$ |5 n8 b7 [) r! W% V1 G1 }<>'*********************************************************** ( D2 L% ?! H/ T" j
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ( O, D  K3 Z; k- B, Z" m* m6 F0 n
''@PARAM:  - oSQLDB [object]: connection-object $ a; ?! N/ u5 ]5 y
'*********************************************************** & }: o+ v* u$ Q# C
Public Sub GrabDatabaseInfo(byval oSQLDB) 7 i1 U$ q- q3 w
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 5 P" m6 A- F4 d; k
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
/ d% f; v% G3 j9 @% E5 k, l   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"))
  p3 f0 p* J0 s; ]5 Q* g4 u   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) / `: u- a, z8 b2 V2 B
End Sub <>'***********************************************************
" z8 n0 t$ U; s( |) C/ c1 J" i. ~'* PrintDatabaseInfo 4 l# v' e" J5 Q/ T7 w! C
'*********************************************************** / ^+ g; D  L7 a. n7 Y  E
Private Sub PrintDatabaseInfo(byval DivSetNo)
% \4 [8 ~8 l; t   dim tbl
2 g. N6 E# \) k( L+ h# f. |   tbl = MakeTable(dbg_DB_Data)
8 p, F7 Y5 h5 w1 f5 x   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) / |' n: F- |% i* o0 U8 q
   Response.Write replace(tbl,"|", vbcrlf)
, Y' k/ z* Z+ \End Sub </P><>'*********************************************************** 2 b  U& V, y/ x; A/ p
'* PrintCollection , ]+ }8 d* }/ f; f- b8 i, h
'***********************************************************
- Z: m9 }6 M8 x5 ~, \Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) - }  [' l9 }- y  ]7 V1 M* \/ h/ L: a
   Dim vItem, tbl, Temp * B2 @+ Z  h7 r6 I1 S- Y  I5 N8 F
   For Each vItem In Collection % V. L+ u) c, ~
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
6 l9 Y$ F& A2 V2 ]. h% Y       tbl = AddRow(tbl, vItem, "{object}") / d$ T: T' l" f' h/ T" e& m' z
     elseif isnull(Collection(vItem)) then 1 x0 e) m* _+ f
       tbl = AddRow(tbl, vItem, "{null}")
# S& V4 {# R# E0 {+ {     elseif isarray(Collection(vItem)) then
( ~# u; j$ s4 S8 t" j* p       tbl = AddRow(tbl, vItem, "{array}")
& m( ~, p3 r# u0 l- ^     else 4 E4 ?/ @, }8 g4 X; E# ]
       if dbg_AllVars then
" J3 M  N; A0 B5 b7 h. J       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ! t0 {- F  A% i0 c
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ( R) n, {; L# p- T( P- T
       if Collection(vItem) &lt;&gt; "" then . ^$ r% O- L, i
       tbl = AddRow(tbl, vItem, server.HTML! E' c! U5 k1 J! }
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
, I+ n6 _. F( Z0 u       else - ?8 F; \5 T  K0 G- e# J6 v. k+ C4 @
       tbl = AddRow(tbl, vItem, "...") & s3 X2 T: X( t/ |, {5 G
       end if ! p8 }; b6 ^7 v( G( d
     end if 7 E9 Z; W2 |* D0 o- a
   end if , u4 l% Z- C) S3 o
   Next ; C, ~5 W) V" K- u9 i. s/ ^  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
- T4 V7 b6 W. o( C( E8 h  O   tbl = MakeTable(tbl)
. c# t& y8 u3 p; K! g   if Collection.count &lt;= 0 then DivSetNo =2 - N! P, z. N  }# E- n' M7 _
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 r# {1 ]3 }8 {' G4 M! @$ `+ [
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) - d- }3 V0 M. P- J: ?1 [# ^' V
     Response.Write replace(tbl,"|", vbcrlf) # A" {" @( T7 `0 y+ A# Z6 n& T1 C
End Sub 8 J& {+ {+ [' v1 \
  
$ m5 K# V0 _& o+ W9 F. Z- F'***********************************************************
! s/ q9 N5 @% h1 G' h'* AddRow
& ]4 j8 k2 U3 z  q, R# T6 e'*********************************************************** . M( S+ _% w1 o% c% j. H- ?) u$ e( p
Private Function AddRow(byval t, byval var, byval val) , _; e7 X9 ?" _+ ]
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" $ i, M7 r! x. f
   AddRow = t
% q0 C2 n4 U% ^End Function </P><>'***********************************************************
2 L1 J% s0 A5 ?) a'* MakeTable : G2 G+ E5 I" J& E2 B' O' T% [
'*********************************************************** 9 d+ t* }. g" a# q2 Q6 s
Private Function MakeTable(byval tdata)
, p4 K. y$ ?# w* F% Z   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
% g* J# I7 \& [2 m   MakeTable = tdata 2 p( V- P- k2 r; Y6 p+ `' [: T
End Function </P><>'***********************************************************
  B8 A2 C# X" u4 g- X; H  r1 r8 I''@SDESCRIPTION: Draws the Debug-panel 0 h: Y8 |+ S0 N; O. s
'***********************************************************
5 t. L: W: v% r& V8 z* \Public Sub draw() ( C; n4 D) \$ y3 c$ J
   If dbg_Enabled Then 2 R) _4 X: u: C4 ~5 z: d% l
     dbg_FinishTime = Now() 6 G7 M+ ?, T# P! A# Q9 G
  # P! D+ y- j' |. S; E0 s% o$ v
   Dim DivSet, x   u2 _) {  E* S- m# g
   DivSet = split(dbg_Show_default,",") 0 s0 q9 ]& _3 x  Y; }
     dbg_Show = split(dbg_Show,",")
+ P* z) z. q, Q) {3 Y6 w  
# K6 [# s5 |. Y3 |" j) q& i9 V   For x = 0 to ubound(dbg_Show) - B& ~& Y# T/ V8 \: n, X6 W* t
     divSet(x) = dbg_Show(x) 7 W4 e9 a6 F2 a: g- I
   Next
- ~& n; ?2 Y6 j9 S& G  
8 |9 w0 @+ i: @( P" s   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;" . k! `) o: L, ^2 B3 S; }- X% x
   Call PrintSummaryInfo(divSet(0))
  t- g; m; T; h; g+ y; y& {# l8 u& \     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( `& k3 v! W# N8 U    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 9 p' s" p/ y2 u) E/ Z
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
3 t2 Z( r7 x& T6 O    Call PrintCookiesInfo(divSet(4))
7 ?: Z" 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)) ' S+ f' L$ _9 F7 ^" G
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; v  Q2 v" x1 W7 z% L% P
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 6 E* c% f" j- t, q( Q/ U
    Call PrintDatabaseInfo(divSet(8)) 7 u7 s# _( t& p1 M) W; v7 `+ ]
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 9 H- m3 [# U) V
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 9 i, \# r2 X) H; P7 [. F1 w- |
    Response.Write "&lt;/Table&gt;"
$ g; J: n, |5 K& j. a% [   End If / U/ o! G& ?1 }6 c
End Sub </P><>'Destructor
" x# U7 Z/ x, V' r: BPrivate Sub Class_Terminate() 3 K4 o3 L; k6 x1 G' `3 Q
   Set dbg_Data = Nothing
. G" R) h% h4 `+ LEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
& Y$ ^7 _. Z8 X$ QCLASS debuggingConsole
3 V( P) X  j$ f8 V& FVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
- e+ H8 H5 t& A3 j+ ~( l&amp;n5 O+ J# y5 \0 y7 o% {
bsp; / @+ T0 m& z) _) f/ l* \4 [' o
Property Get Enabled===[bool] Gets the "enabled" value
: y3 \2 d8 c$ ^, `& m  " ~+ `" O+ N) |
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 , Q% Y7 ^. a' X. I% R/ Q8 p2 i. D
  . a( t! V8 M8 J, e+ q
Property Get Show===[string] Gets the debugging panel. ; i  J6 }- _3 J: T: q
  & B9 ]! X# T$ S3 ]7 @9 ]7 b4 T
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 ~" W; ?7 E4 }/ x& M5 @: K1 `Public Methods </P><>public sub===Print (label, output)
0 y, `8 z% `$ C1 F   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 2 d4 o# z( X+ a. M* i9 [, d
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()   Y4 y* m  H# K5 l3 V
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ; U" a! [, w, B! t" p" Z3 [, X
Methods Detail / h' v+ M$ j8 \# H. t  ^0 g( P) e
  
0 j9 X+ h" A: Y/ T) V. Cpublic sub===Print (label, output) 9 J- @, m, [* P, H
Parameters:  0 {2 y; A% a% @+ |
   - label [string]: Description of the variable 8 I3 z6 t& |8 c
   - output [variable]: The variable itself 9 l) c" c) J# b/ l0 f
  
3 X0 ]$ [, p1 H5 A# w* F6 jpublic sub===GrabDatabaseInfo (byval oSQLDB)
# K/ A' h: z! k5 e1 g8 oParameters:  
7 {0 j& N+ b" v8 T9 P7 q   - 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-21 07:28 , Processed in 2.432064 second(s), 56 queries .

回顶部