QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6588|回复: 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 q4 o, u) ^' k4 J. [% M* z% o
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! & C: ?$ z& V" I& l2 G' T0 }8 |
使用方法很简单: 7 c7 H' X7 @% @; _* t9 [
test.asp </P>
6 X% D, i, r9 j1 Q+ h; \6 I  A3 d1 m) f<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ) R6 p+ t. ?& u( ^9 C. N7 y/ ^
&lt;%
2 y: Y. M* Q3 U) voutput="XXXX"
/ f* R: @3 K( u) SSet debugstr = New debuggingConsole
8 s, g: {/ x, I2 w0 qdebugstr.Enabled = true
- k, e' J  G$ ]' l% L/ Q3 S   debugstr.Print "参数output的值", output * v/ R9 Y& R7 m" {* {$ w' i
   '……
) A9 `8 W: P* G/ L! U: r1 D8 q   debugstr.draw 9 X- R0 X" a2 M2 D
Set debugstr = Nothing
0 O5 _- T; Y3 w" \( X6 J%&gt; </P>3 z: V8 i0 @" ^
<>=================================================== </P>9 u# F" }8 ^% g/ j+ ]  T
<>debuggingConsole.asp </P>
# z. y& u2 `+ O9 P" x# }<>&lt;% & p  v: Y: j5 R" D. Q0 D. V
Class debuggingConsole </P>+ T( e/ r' q1 C3 Z" {% ]/ F# M
<>   private dbg_Enabled , o+ E2 k7 l. P! B+ r2 B; }
   private dbg_Show ( Y0 `$ L* u' S+ J$ W8 {
   private dbg_RequestTime " R8 f9 B) d& l$ V& d
   private dbg_FinishTime 9 g# r4 N" J6 d+ R$ h8 i0 P+ ?& C
   private dbg_Data
3 i  {  s/ i6 p& g! p* L( _   private dbg_DB_Data
( v4 K5 D, r9 x5 N" ^! M; c8 F  i   private dbg_AllVars - I/ U$ A8 s  u% {
   private dbg_Show_default
3 H5 G* E; o& b8 P   private DivSets(2)
2 X1 l9 j6 s: U, k   
# t, A% M; c( x/ O& I5 x'Construktor =&gt; set the default values 0 s) D  ?0 J1 k% ^, I. T
Private Sub Class_Initialize() : y1 [3 s0 a+ o  i
   dbg_RequestTime = Now()
/ M, z6 \4 y+ T4 J. n% m" B+ J   dbg_AllVars = false 1 \; j" ^7 E6 M" l# |4 H
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
9 u& G* \: ]3 y1 Q* [. x<>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>$ o5 j* \& a4 f! z& A; J
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;4 ^3 Y$ \8 n" q% ?1 W8 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>
- }7 X- f% I1 G6 l<>   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>' h3 [: E2 W; R$ o& T+ ]
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" * R+ p4 l; T2 _8 T( [/ W
End Sub </P>
) x) o: N' e6 b3 U<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
: ~6 N+ W! R8 I. b3 R   dbg_Enabled = bNewValue " H3 {; n/ j$ O/ ~+ g6 M# h
End Property </P>% s9 x/ o" q  l/ O" l' O! u2 J
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
7 G. }. A% c2 q2 O   Enabled = dbg_Enabled
3 F. u1 _/ L7 PEnd Property </P>) U# o/ A, a; J+ N
<>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 9 ~+ u* U! B6 ]! P
   dbg_Show = bNewValue
, ^7 q0 o6 f! }' ^$ a' [End Property </P># S6 Y2 E# Y& r) n
<>ublic Property Get Show ''[string] Gets the debugging panel.
/ G# y0 ?$ Y- m' d+ b   Show = dbg_Show
+ V" b/ ^9 o# v8 Q5 Y, GEnd Property </P>' O+ P; E' z8 d/ Q/ C; P, k
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
9 d: E+ Z, h9 c. Q   dbg_AllVars = bNewValue 5 ?+ ?( Q$ Z/ g1 T$ i
End Property </P>$ v: t; M' l1 T# Y8 ]6 g; Y
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
' b! f% \  e9 B1 [   AllVars = dbg_AllVars # h1 V# N$ A. |5 E# f$ I# A
End Property </P># k$ ?6 e+ Q) E/ b
<>'***********************************************************
7 P/ T* m" I) w8 M''@SDESCRIPTION: Adds a variable to the debug-informations.
- F; o3 N* \7 |- Y& g9 [) a. V''@PARAM:  - label [string]: Description of the variable + ?' g! s! \6 {1 C# ?0 V, U
''@PARAM:  - output [variable]: The variable itself
' W. j6 y8 v  N4 S% C'***********************************************************
" s. V7 K1 @+ ^: n) ]1 R9 h  l& w  uPublic Sub Print(label, output)
$ H1 R0 R" c* M   If dbg_Enabled Then
( B0 b. i* B1 z# j8 z5 @     if err.number &gt; 0 then 9 y2 @  Y. M& ~: T* d. W1 _1 K
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
1 n. f6 h% O# f& {, H5 z       err.Clear
2 i: }, X1 g4 S' n1 P" P: M0 b     else
0 A6 B# a' g. e% U3 n4 i9 L4 C       uniqueID = ValidLabel(label)
/ j. w# T! F& q       response.write uniqueID 0 A  m* V& {: R7 \0 F  L0 A
       call dbg_Data.Add(uniqueID, output)
3 P; l7 O9 q; t& N     end if
$ l5 ]! z) f- h, E   End If
/ J& C2 E* k0 Z9 q9 h; lEnd Sub
8 ?: H3 U% ~3 R2 r( Q& X; |  @# f  
1 t) \: U2 _$ V3 [1 z7 x'*********************************************************** 8 [* d! k( o! a' j# y4 {
'* ValidLabel 1 u7 Q# t! ~0 D7 T  {2 O: p
'*********************************************************** + G, U) A- X* K+ v6 {( v' w1 L
Private Function ValidLabel(byval label)
% ?; n' N9 _6 w8 [6 |   dim i, lbl
. h* i' @: ^0 a3 q3 H   i = 0 & \+ ~7 z0 M$ R
   lbl = label - d' c6 v& ^) j8 H8 r+ {- g! r
   do
6 a8 j  o; k0 a3 E  |   if not dbg_Data.Exists(lbl) then exit do 0 x* z3 b/ s; c$ W  [" E* O
   i = i + 1
# P$ T4 L( Y. @, N# l, ]4 X- u   lbl = label &amp; "(" &amp; i &amp; ")" ! ~1 {5 T4 y& _* O3 y
   loop until i = i 8 }7 `+ i0 Y* s. l" F
  
- C; [! J$ ?4 {) G   ValidLabel = lbl + p* l& y: p5 M. K
End Function
' U" d& _5 d3 ]: p2 G6 `7 Y- ?; H  : j' M! n. B, |
'*********************************************************** " t$ Z: Y: |  I) x+ y  n
'* PrintCookiesInfo
. q5 Q7 K5 i9 _( M* D9 d'***********************************************************
7 N$ u* R' p: Q$ a* PPrivate Sub PrintCookiesInfo(byval DivSetNo) 2 q7 ]  K6 F6 f; [
   dim tbl, cookie, key, tmp
# W4 W: D; U4 s/ q4 g   For Each cookie in Request.Cookies - t2 P- S! Q, v" V3 g$ u- }0 [
   If Not Request.Cookies(cookie).HasKeys Then ! v+ S" l* L  A0 f
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   5 Y# _7 t& B% h
   Else   i' ^( B7 F9 G1 F% h# s
     For Each key in Request.Cookies(cookie) : y- s# o; Y4 E) n. [: p; [' D8 d
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. + z* v& h5 b9 H  S* ^
Cookies(cookie)(key))   0 @8 i, [' H" t+ @
   Next ' d( l  C) \8 s# F- ^6 ?
   End If
( \" g7 _1 q# L  ?& C0 m' i4 d   Next </P>! U6 ]' m1 E0 w& A
<>   tbl = MakeTable(tbl) - l" f5 m# ?4 U; H
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
; f4 z7 Y' i3 Q) m% X% X" u   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
7 b5 u0 s# @% C   Response.Write replace(tmp,"|", vbcrlf)
* l* d( Q' D, {7 lend sub + m& c& O! o' o: L
  " Z1 s' A1 I1 \' K2 M# T1 I8 p& j
'***********************************************************
7 x& ]8 d( }% Y: N8 H'* PrintSummaryInfo ' w* L% z* f5 _" ?  m0 H, C
'*********************************************************** % _$ ]; s" b: m, G
Private Sub PrintSummaryInfo(byval DivSetNo) 9 \8 e- L* Y( Q* T
   dim tmp, tbl # p, x9 ]4 P& q5 q" ?0 F7 ^
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) % \/ h' ?% \7 h% E! v
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
9 ?4 v, o9 v) A1 O   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
3 @( ~% q. f3 s$ x) j4 t   tbl = AddRow(tbl, "Status Code",Response.Status)
8 ~* f& P" A& e9 o4 `   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
4 u' {% F. ~+ R: d! T; r/ d   tbl = MakeTable(tbl)
, _7 a* H( r9 U" y& B; M' l) _7 J" s   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
. J* h. M5 _, M3 u   Response.Write replace(tmp,"|", vbcrlf) % q  k+ }6 \/ a
End Sub </P>
- o8 M6 Q# A' k3 ?9 V; T- O. I<>'***********************************************************
. q# t" K0 }# x$ a1 A  U''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
, V$ C* q! V* U4 u' G: G" D+ m''@PARAM:  - oSQLDB [object]: connection-object
9 T* d1 J8 R8 I& y( K'***********************************************************
, r2 w% f1 s- j- m& y0 U1 cPublic Sub GrabDatabaseInfo(byval oSQLDB)
4 p( m5 K* V2 h9 b$ }6 n) J) }   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
3 H1 d6 B% i4 J- i$ K) \- s   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
$ A+ S6 P8 A# W! t   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"))
& C4 B+ Y& L5 A  B2 T7 n& |  Q   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
; [- t6 ^5 y; N3 GEnd Sub <>'*********************************************************** ) b2 M5 J* z4 r0 v
'* PrintDatabaseInfo
- D" b/ h4 S8 x) t# ]7 \- V'***********************************************************
# q) l6 w  t+ [- g# C( L; G. {Private Sub PrintDatabaseInfo(byval DivSetNo)
+ r4 ]6 ~, V! D" Q7 `: D   dim tbl 4 y0 [; d+ h6 a1 n8 W% x9 x
   tbl = MakeTable(dbg_DB_Data)
0 H8 L: W; j  F& W8 X4 v/ N   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
4 M' N+ O$ D' P   Response.Write replace(tbl,"|", vbcrlf) * W( H* A1 m0 R) k0 |6 G& z
End Sub </P><>'*********************************************************** 3 b9 [. S* U0 z$ ^: g$ e4 b
'* PrintCollection
3 o  ^! ]) C- K'*********************************************************** & L5 d1 X' f5 h% Y6 \: F! Q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
  W) I; d) o/ P" y' M   Dim vItem, tbl, Temp
& d* m6 [+ w+ l& W9 }2 A   For Each vItem In Collection
3 H" \6 [9 B+ f2 Y. X     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
! {2 O, _; n& H) p6 B/ E       tbl = AddRow(tbl, vItem, "{object}") 0 |: Y  H7 w, D8 s$ a% n+ {3 _
     elseif isnull(Collection(vItem)) then
( Y: h5 t0 B( J4 s" f, {) n       tbl = AddRow(tbl, vItem, "{null}")
- w8 x# c, r( B# d* J  q     elseif isarray(Collection(vItem)) then 0 f+ ~9 I6 y3 {+ B0 a  c2 v9 V
       tbl = AddRow(tbl, vItem, "{array}") 6 K3 ]2 z+ V9 s, d7 i) e: |
     else / ~. D% N& Z2 m$ V8 ]
       if dbg_AllVars then 8 x& E4 ]( E6 N1 F* U, }1 ^
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
! N* R5 e) F* F     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
' W- v2 r# M! q" ^       if Collection(vItem) &lt;&gt; "" then
* l  E2 O. w' ^' ^: z+ t( o       tbl = AddRow(tbl, vItem, server.HTML
) M0 [5 P% r+ i: N3 gEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ' ]9 H6 H4 r, i$ F
       else 4 B: C1 b- {& B$ u
       tbl = AddRow(tbl, vItem, "...") 2 l' @( L1 e- n! S& V
       end if * ]6 a$ `! f1 I4 p- ]% s
     end if   |0 e5 v  D& h/ R" C( S7 K
   end if
# s) J6 Z; L( u   Next 1 ^2 a% A: O( a, Z
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
1 M2 E4 T3 P% a. U" D   tbl = MakeTable(tbl) # M# Y4 g$ E) n
   if Collection.count &lt;= 0 then DivSetNo =2 4 F, k9 ]5 d0 h$ H" w
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
( v/ z1 L% J+ v: v3 r     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 j, ~2 [& _2 @7 `. e8 Y) m+ S
     Response.Write replace(tbl,"|", vbcrlf) " o  I  N  L8 P- g  C* v  h
End Sub
, ~  F& k* P7 @- C1 ]8 R- _* p  
: Y1 v1 F2 q3 v+ v/ Y% p'***********************************************************
' P" C3 m4 n% L2 d6 y) ~'* AddRow 6 _0 w/ T$ ?7 W, l
'***********************************************************
" {# z& z$ [$ |6 q$ `# N! Z) @Private Function AddRow(byval t, byval var, byval val) + d& T) S4 |# \. u
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 0 ]* ]) `  p# }$ \) X
   AddRow = t % H! U* Y5 m# W- K8 K6 X/ s
End Function </P><>'*********************************************************** 8 A# m1 G* Q# d" ^: G0 I6 J
'* MakeTable
) O7 H3 B# R, m/ a* h' Q7 K1 M'*********************************************************** 1 F( X6 e7 n5 y# H& ?
Private Function MakeTable(byval tdata)
' s) p% @6 I4 _! O   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
1 G3 Y2 U$ B- U% K& V   MakeTable = tdata
6 ^' F/ p8 l9 I2 T8 ^1 C) VEnd Function </P><>'*********************************************************** * k. R1 v, _1 u1 G1 n
''@SDESCRIPTION: Draws the Debug-panel
  u4 J, [! H4 @: s- ~7 ~$ G'***********************************************************
' z* @1 C3 U) SPublic Sub draw() , D) W% m8 @1 U
   If dbg_Enabled Then : e# z8 B0 T( z" U
     dbg_FinishTime = Now()
( X, X! k. o: x  # y( Q/ @. i0 r, P2 |8 z" R
   Dim DivSet, x , {  ]/ `+ q% t& W2 f
   DivSet = split(dbg_Show_default,",")
/ H. g( k+ A/ {7 d& m4 v$ a     dbg_Show = split(dbg_Show,",")
1 Z- g: E1 ?/ C2 y' ^. z  % a: q% K* k# {0 |" k, Y
   For x = 0 to ubound(dbg_Show) ( d! y1 H$ _6 _8 q- |
     divSet(x) = dbg_Show(x)
2 i2 r' d+ }! h( A9 p5 n   Next
6 b7 M7 c: ~; U. Z( Z+ D7 F/ w! o  
+ \: [6 M/ {: ^  Z   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;" 0 y' `. }. w9 O  j9 G- ^
   Call PrintSummaryInfo(divSet(0))
! X& ^; m% G9 Y' d1 u     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
  ?9 y  }6 }& X0 Z9 m    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") : f) M+ B6 j. x0 {. a8 E4 ^
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
- m, F, C! r- h& W" C- z    Call PrintCookiesInfo(divSet(4))
: t8 F+ z% {2 V4 Z/ r& d    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)) 8 K+ Q$ N/ N% |1 m
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; o% @- p. b: {# j( l
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
% c) m' p, _% \$ ~- x4 D    Call PrintDatabaseInfo(divSet(8))
! K% a2 j% d6 \- B    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") + o5 W7 R- P$ ^( R6 e- O
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
( j  E' z" L" X3 d7 ~5 N4 o    Response.Write "&lt;/Table&gt;" 5 S* A4 |2 ^0 @$ e
   End If $ z! N  J5 o, c* O
End Sub </P><>'Destructor * s( G1 g8 B/ k
Private Sub Class_Terminate() # n5 ?- a2 y2 L8 L& i( _3 X
   Set dbg_Data = Nothing % n+ ~5 Z5 Y( c4 d/ e
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>0 W3 s7 U3 A: ?. Y  |
CLASS debuggingConsole ! g7 l9 N1 q% G1 A; G! f& j
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 I( }" B, n+ m4 T6 D. Z
&amp;n: G2 |; x' p6 G! v
bsp; 5 V7 ^/ [1 a7 o5 o/ L# d
Property Get Enabled===[bool] Gets the "enabled" value
( }4 E0 T& K. M/ G  
( z( O  X8 W3 j- P7 {% G8 BProperty 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 8 k% w4 k- Z( K; L) ]& m
  4 s+ r: J% G  w6 N5 W
Property Get Show===[string] Gets the debugging panel.
4 N0 Z+ h0 _4 w$ ?4 ^  0 b/ k6 o( x5 r$ y- i! q% O# K+ m& b; 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><>--------------------------------------------------------------------------------
! j4 R* M3 p+ o- c% |: |3 BPublic Methods </P><>public sub===Print (label, output)
' t& |/ o3 C! h- o- @   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
2 n; _% Z- ]  |* ^5 w3 }, E  m   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () # h" D! w9 K' _
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 8 K2 b% \( E: S$ [6 {% a  |$ x' m
Methods Detail
2 k$ O# \% j6 I4 Y7 F* \  - {) X& t: `) `1 Q9 \7 l: @
public sub===Print (label, output)
. B0 J5 C: H8 q! b- vParameters:  0 g7 s" u+ E, \( f
   - label [string]: Description of the variable
* |" u! w- o1 W1 Y, Z1 ^# v   - output [variable]: The variable itself
+ u8 u; n8 U5 a/ t: H  
! b$ R: U# m2 ~, |: hpublic sub===GrabDatabaseInfo (byval oSQLDB)
1 `# I6 S* x7 }$ J) O9 `Parameters:  
6 s2 ^. m3 V! ~( w# ^- t  |, z  M   - 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-1-5 00:11 , Processed in 1.140310 second(s), 56 queries .

回顶部