QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |正序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
% i$ ~5 T7 g+ P<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
$ P; s4 N4 i1 C; ^1 w2 a7 e. N; R使用方法很简单:
9 `- J+ {! ^1 e4 qtest.asp </P>6 Z& p7 |( S1 H. q. G  {  e
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
) b" ^+ Z* p/ w1 l  c  f! o( ?&lt;% 9 P! S6 Z, E, {4 T4 Y& X
output="XXXX" : `& [* Q+ s) V5 c4 |2 s
Set debugstr = New debuggingConsole
. k$ I* c; k/ hdebugstr.Enabled = true 2 U& T+ p' V: a. B. V8 \6 S
   debugstr.Print "参数output的值", output
: l9 E8 M! Z2 t   '……
7 r* j! O' N, h' t, z   debugstr.draw 8 e5 H2 \& x' ^4 Y7 i# ?; k
Set debugstr = Nothing * J4 n0 }1 ~6 j, q' l
%&gt; </P>
8 i0 Z% S$ f% X<>=================================================== </P>
# B+ U' J% P; E<>debuggingConsole.asp </P>
; I1 E$ Z0 O/ |5 A* V<>&lt;%
: k9 k1 k/ c3 b& ^$ A8 KClass debuggingConsole </P>
) p- W& D9 Q: g9 _- m# w% {<>   private dbg_Enabled
$ H9 k6 \& P" B' E1 v8 T& j   private dbg_Show
& R3 X8 f: q- ~# v; L- B   private dbg_RequestTime 1 `- D/ ]6 i) }& }' r9 \! A. p
   private dbg_FinishTime 7 ~; W4 ~3 A7 s/ e; c
   private dbg_Data
# T# R1 g' T% u: B& _   private dbg_DB_Data
& w6 O& u" k" J3 t1 D7 u6 W   private dbg_AllVars ! U. N9 }- r4 J- N" J% K
   private dbg_Show_default
3 H4 i7 E/ Y5 w9 N7 \$ g   private DivSets(2)
/ [: W5 N6 H3 m   
+ v0 L8 \# J1 |'Construktor =&gt; set the default values   |, K8 ~! ~9 L- J! m- |
Private Sub Class_Initialize()
. r4 ^$ o. a" ^4 ~! R5 U* |   dbg_RequestTime = Now() # B) I- R2 V  D+ Y+ p% D# j
   dbg_AllVars = false ( r& Q1 i9 e- h! m/ P
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>' P9 U3 z9 v+ C. |4 R
<>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>$ q' K! w% Y6 J, @4 G
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
- z& i( I# ]: \0 q&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 {2 J6 e4 o' P3 C1 z; y
<>   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>
6 W! E7 h" X3 o6 d9 f<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
; k- v7 j' A6 e: H- {2 L$ pEnd Sub </P>! m, P* ^; |; v/ k3 Q5 j
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 3 u" P/ w  |/ P' D1 ^
   dbg_Enabled = bNewValue
1 s, ~. D6 k3 P8 _: Z% HEnd Property </P>
4 {' P- P$ h% {2 i, ~<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
. H4 z3 \( v/ O$ y# E. G0 @7 Y   Enabled = dbg_Enabled ! x8 i5 H7 D2 Q' B; ^6 N. W9 [+ t+ y
End Property </P>+ r- d/ X  u, h- E. K: q
<>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 $ J( p2 Q, p% Z! a
   dbg_Show = bNewValue : e" R& z1 g6 \/ B+ R" C5 N
End Property </P>5 j! O5 E2 g+ ^* k) |0 B5 Q, o" C
<>ublic Property Get Show ''[string] Gets the debugging panel.
7 A* ?. y) q9 B" I3 F2 p- O  h   Show = dbg_Show ) V4 ~3 {4 K( E' w
End Property </P>5 ?$ f2 `; q& n8 R9 d$ P* k
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
/ K2 ^4 D2 r: K" ~9 ~! f   dbg_AllVars = bNewValue
$ C9 c2 Y" ^) X2 j$ XEnd Property </P>
# s+ s& E, u1 M. d<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
, B/ m7 B9 t4 G  ]' C   AllVars = dbg_AllVars
. t. y& @7 ]7 h& ]# E6 u: cEnd Property </P>
  m& z9 ^' J( N1 D. Y2 x1 w" L<>'***********************************************************
! R+ t" D: ^5 u. t% D''@SDESCRIPTION: Adds a variable to the debug-informations. ( Q& n& r8 S' H; X% b2 z, y
''@PARAM:  - label [string]: Description of the variable 6 f) ~; y8 T; B  G4 y
''@PARAM:  - output [variable]: The variable itself
9 \7 |* f! X2 r, o# k5 m$ C3 ]'*********************************************************** 4 a) S9 b9 N: M5 n9 P" ]0 ]% }3 M) \
Public Sub Print(label, output) & X' I4 e9 r, ^4 T
   If dbg_Enabled Then 3 n* m% U+ A9 h( c2 Z
     if err.number &gt; 0 then
) L; u3 s9 a9 Q+ {, W- O       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
5 o$ b' K# F! Y7 l       err.Clear
- F+ D- G) Z* J! b& z     else
' A5 h7 e: s+ [       uniqueID = ValidLabel(label)
5 {2 H! \- @' L" w       response.write uniqueID
: a. D5 Q& H) o( y. M       call dbg_Data.Add(uniqueID, output) / N. s% G. X0 A# X  Y% C- o/ _
     end if : g1 M* A3 p/ w  ]3 j
   End If % q& ~) K# O6 f, ^. ^. q* y- O/ Y
End Sub
: @+ f( O' x+ z$ W, F  : m- k- ~; Q+ t
'*********************************************************** 1 r5 j+ G! \  ]4 k1 U
'* ValidLabel
: {: @6 M1 U7 r; c. B'***********************************************************
  Z7 k% E) g9 X5 j# ~' tPrivate Function ValidLabel(byval label) $ _, K0 }! g0 Z: }
   dim i, lbl % A! n- |& W7 F( D& w
   i = 0
& I  q) \5 A0 n- I   lbl = label 9 U6 H: s1 m2 r
   do
& `: i4 [/ d* ~$ {" V: G% `$ M   if not dbg_Data.Exists(lbl) then exit do
: K; ]6 I2 {! B+ o# k# M) X- a$ a   i = i + 1 / V7 g1 I9 ~" [$ v& @+ K
   lbl = label &amp; "(" &amp; i &amp; ")"
; U) G7 b8 {% u" F5 u9 J3 F   loop until i = i
* [: G' b( W  u  3 S* p3 K+ q- ~  A; A. j
   ValidLabel = lbl
- v' M6 x% n$ g) |& YEnd Function 0 L, ], R: I- X
  
! ^  U4 ?; ^) @) F3 X) q4 \'***********************************************************
1 i: N. R! f, M'* PrintCookiesInfo
0 c; v  k9 C0 }1 J8 v'*********************************************************** ( H( }& ~( i7 b& P9 q8 O' V
Private Sub PrintCookiesInfo(byval DivSetNo) " F8 u1 m" b( h: ]- a
   dim tbl, cookie, key, tmp   m: ?& G5 l# j- Y- G2 u6 \0 a; b
   For Each cookie in Request.Cookies ; `, j# k" Z0 X7 D
   If Not Request.Cookies(cookie).HasKeys Then
+ r2 I3 f, L# [" o# ~     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
4 A  Z0 ~4 K5 ]   Else
3 {' \+ B5 {/ _     For Each key in Request.Cookies(cookie) & T4 H% f% N: c/ F, J, d
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 7 W8 A8 G( q. ]. F8 Y: u) r$ s
Cookies(cookie)(key))   
! S! f7 A# p  r6 d7 h   Next
5 n; F! I. a  l   End If , a. A6 d" I" ]$ D* m+ ^; C
   Next </P>" ~, ~* H. n) t. d, ]
<>   tbl = MakeTable(tbl)
" U& |& m% p# q8 R/ G( s# `   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
# ]: R8 ?5 c/ d   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
2 P2 a7 f: s2 C& z* X/ e' `   Response.Write replace(tmp,"|", vbcrlf) % A8 x) E3 A9 V$ r" @, ]
end sub
* p! ?- h. E3 q  
( P: [& R; p+ I$ p$ J6 t'***********************************************************
& w2 L0 r2 N  X" ?7 X'* PrintSummaryInfo . \. u' q7 J) Q
'***********************************************************
4 R9 G( U% K' z: B* p6 lPrivate Sub PrintSummaryInfo(byval DivSetNo)
' C$ ^6 f( H: J, @   dim tmp, tbl
+ `4 R2 b: m0 f$ u. w/ ]3 u8 _5 ?   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - {3 f# A5 o* @; Q. t
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") , J5 Z. M& _% F& S
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) + Y! E+ f; q! ^8 G+ A, B# U  X
   tbl = AddRow(tbl, "Status Code",Response.Status)
% |$ W4 b5 M+ W$ w1 r, r   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
+ \* D) z; i  V4 R   tbl = MakeTable(tbl) 6 q6 ?+ a% Z& G
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
7 C0 G6 k3 X7 [* G4 o  A( R5 X   Response.Write replace(tmp,"|", vbcrlf)   H) y6 i5 h1 d$ h! v
End Sub </P>( J  B  H* U0 m9 O8 O# U# o$ R
<>'*********************************************************** $ [1 Y8 _1 r- N" L1 L6 [. T$ Z, U
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
) d) r9 r# Y; X* _! I. B" L& z''@PARAM:  - oSQLDB [object]: connection-object : |! r' [3 y# i) l; n
'***********************************************************
7 k3 z5 v" w) h4 TPublic Sub GrabDatabaseInfo(byval oSQLDB)
: H' Z, q4 I# R3 ~. @( |   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
' [/ r! A0 d. y   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) % C4 n/ }% N) R+ r7 j6 [- v
   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")) & ]& s" [% ~, j
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ( `0 w2 f+ ]4 @0 Z/ o
End Sub <>'***********************************************************
, K2 g- h% E9 D3 a'* PrintDatabaseInfo ' v9 {( N: @4 K2 n/ ?
'*********************************************************** + ^! B7 q; V4 W% n
Private Sub PrintDatabaseInfo(byval DivSetNo) - P* s# d  q+ b
   dim tbl 5 q, I. y5 K/ I4 f* u( I- N
   tbl = MakeTable(dbg_DB_Data) 6 {$ {! P* r) K* Z
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ' Q: c2 G; e* W" C1 u1 U- f
   Response.Write replace(tbl,"|", vbcrlf) , I! V, j8 i2 w) z1 Q# m. k
End Sub </P><>'*********************************************************** 4 t# v( M# V3 `$ z
'* PrintCollection - k& h8 J: }) Y8 n0 J& ^$ a
'***********************************************************
' m9 e$ H! K# j6 a" G$ uPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 4 t$ j) o" E) x0 }1 f
   Dim vItem, tbl, Temp 2 h  J2 {. r+ h
   For Each vItem In Collection 1 I- Z- e+ e+ `
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
* H) l+ i* N5 w3 u7 M: M& \+ P       tbl = AddRow(tbl, vItem, "{object}")
( {% n# f' ]* H$ E0 R  B     elseif isnull(Collection(vItem)) then
4 a" a& Z$ u  Q( C# E" @       tbl = AddRow(tbl, vItem, "{null}") & a  Z: R/ ~  O) y
     elseif isarray(Collection(vItem)) then
! {1 g  _6 V) o5 U       tbl = AddRow(tbl, vItem, "{array}")
0 W1 c) L9 y' h5 p     else / q' \" L9 C0 p9 o5 H! A. p
       if dbg_AllVars then 8 \5 I* ^4 M5 S
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
1 Q4 |( V. U* v/ {1 u     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ! K8 c( ]' F5 k
       if Collection(vItem) &lt;&gt; "" then # i7 B5 J) e1 o/ ]; J2 o
       tbl = AddRow(tbl, vItem, server.HTML
: K  S9 x5 q) o( l0 B4 _: o. pEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
9 f) Q9 S/ E0 b8 K; l       else
7 d. n, y6 d6 V# N" F       tbl = AddRow(tbl, vItem, "...") / T* }( Z( z* s, r6 ]
       end if
4 b$ C. P/ h$ G     end if + a# s9 ], B4 w8 {
   end if - r4 g$ C; \6 y2 ^: u3 y
   Next
  i& z5 v' c- h% _% m& |   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
' D  T7 P  |8 x   tbl = MakeTable(tbl) 7 b/ g, R8 m) U; d
   if Collection.count &lt;= 0 then DivSetNo =2
; w6 p4 ?3 e$ I0 Y, d7 p( ]     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
$ C, x( t7 m) J& H     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
  Q) |8 l2 e5 B# _$ ]     Response.Write replace(tbl,"|", vbcrlf)   _9 x7 ?. b8 r/ n. X2 s
End Sub 6 D5 y( O# ]3 a2 ^- R0 Q
  
2 V/ `: }5 S+ s, W" f0 K'***********************************************************
3 x; `& V9 v7 B% n  r. c'* AddRow
# ?/ q$ N: V( W' ]" m( f6 u'*********************************************************** 9 B4 H# _; a2 F( S! N5 v! X
Private Function AddRow(byval t, byval var, byval val) : ~$ P1 o5 r3 T5 P. D# H. S9 j
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ! c$ [3 u5 f. u$ F' q; |
   AddRow = t 0 f2 K% r3 m7 F
End Function </P><>'***********************************************************
* Y: k, j/ X: F7 y) R+ Q8 L+ Y'* MakeTable
, ^) s, S0 N2 X* U* R'***********************************************************
% d$ ?  z% M% H! x6 d+ ~  C8 SPrivate Function MakeTable(byval tdata) # n/ j0 T- V4 V8 S6 k( g! y
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 1 a2 M; O$ q1 C" \( r- y
   MakeTable = tdata
: u8 P1 b' `* x2 V; K9 P/ |End Function </P><>'***********************************************************
( l4 B' ]4 C1 Z' o''@SDESCRIPTION: Draws the Debug-panel 7 g& i, x9 d* l. d- t
'***********************************************************
9 x& P3 C+ y) ?. i# A7 Y0 j( tPublic Sub draw()   ~3 l; k1 t9 b' o% p  _  [
   If dbg_Enabled Then # m* n" s6 n) R& `; x% g+ _
     dbg_FinishTime = Now() 1 Q2 K+ O3 D7 b
  
5 C1 h& y! x! e0 @! U; ?' w6 U   Dim DivSet, x
) i/ n8 ~4 }1 |5 F" R0 I   DivSet = split(dbg_Show_default,",")
7 f6 x5 |, V$ x% k' Y7 j     dbg_Show = split(dbg_Show,",")
5 P' w' Q5 C5 K$ ~" d2 t# ]  
4 z7 c( ~: N, w' @   For x = 0 to ubound(dbg_Show) ; q% j2 J4 q, M' ]2 k% X- w
     divSet(x) = dbg_Show(x)
" e4 x$ w# S" v3 @( N; Q4 x   Next ; q0 I. `1 O: J, E7 d' @7 F
  
$ c7 a* K8 E2 n0 Y7 ]/ L8 c   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;" + l1 p( Q* e9 f1 i" V* t
   Call PrintSummaryInfo(divSet(0))
, g3 P( Q7 p1 F3 |' I! J4 H; ~     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") + |; l# y& N, c6 }
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ q9 G, d4 G/ X1 ]    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, t, C/ ^) p- c    Call PrintCookiesInfo(divSet(4)) , }) ^, x$ R0 j1 P( _+ W
    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))
0 P& t9 H9 P9 P5 T; \    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; y4 N1 ?2 E1 N+ ]; v2 i2 ^
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) & P0 n. g" g1 t
    Call PrintDatabaseInfo(divSet(8))
+ ~6 i) ^4 f: B2 d( @    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- d+ y* Z2 k" c* m6 s8 s; N    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . x7 _9 N. V0 M+ }; H- p
    Response.Write "&lt;/Table&gt;"
" c: v4 J, e7 ^* `; a. i% l4 ~   End If
" o$ |0 S& W9 r# lEnd Sub </P><>'Destructor " C7 w+ s1 h5 K8 ~- B" k
Private Sub Class_Terminate() " U$ {3 M# u- z' p
   Set dbg_Data = Nothing
* k- e8 M. \% M  x4 NEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
# g; ]6 K  Y6 o) ]5 h4 ^CLASS debuggingConsole
! g9 b: R- I9 M. n2 s  I) JVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 4 V2 Y/ h- ]5 j" P+ q, {
&amp;n
# ^: r+ A" a+ U1 b, j' Bbsp;
" |& X: e" y% |9 i! @7 @Property Get Enabled===[bool] Gets the "enabled" value 4 e5 F$ Q; p1 P  s+ m* ^
  * a+ U( ?1 G/ L) |. Q/ O2 w5 g
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
% y7 ]' e9 ~( \9 D; @  6 f' w2 c) a# I( `7 ^  ~( V
Property Get Show===[string] Gets the debugging panel. & d$ m# j- ~, l, V2 E5 i
  9 {5 \, Z' G2 n/ m
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><>--------------------------------------------------------------------------------
) q! K+ B$ _1 H$ E- Y7 c. w8 d3 fPublic Methods </P><>public sub===Print (label, output)
8 G8 l" @4 n  h+ ^3 [1 \   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 8 F* z, z, ^- T/ _; G* S4 [
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
( d* ^: r2 L( ]0 y+ ~* L   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- / e4 _* @/ B- o
Methods Detail 8 i! @+ l, @: H  e# O% @4 t" t
  ' C- v+ L; w0 _, a; [+ ^( S$ j2 H
public sub===Print (label, output) $ ]1 S* P4 d& E+ i- t3 D
Parameters:  
- B3 `% o- Y) w6 `* q  U2 v# I6 l9 Q   - label [string]: Description of the variable
- ?! A4 d" ^8 O5 {8 o% w   - output [variable]: The variable itself
' e3 n' B; A" w4 N  
# U' Q. A( d) C; z! Ppublic sub===GrabDatabaseInfo (byval oSQLDB)
& b% y$ s" N* k. s3 I) x: b, N% tParameters:  % `* b3 p: l+ A$ [1 V
   - 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-7-18 07:27 , Processed in 0.342896 second(s), 57 queries .

回顶部