QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
+ r1 z  {$ y7 c8 @! |<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
) y  _# ^. ]+ S. w" N使用方法很简单:
  Z3 ~( X, m4 B5 Otest.asp </P>
& l+ I' e7 D5 c<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 5 f) Q% e/ d3 u' ~7 r
&lt;% 8 F- t# F# U- C1 ?" u
output="XXXX" " X. a( ^# _( Z1 `% F  s
Set debugstr = New debuggingConsole . M% Z/ j/ T  V" G# Y
debugstr.Enabled = true
$ e8 P' F/ k- o& e) @   debugstr.Print "参数output的值", output
) {0 y! D8 ]. N+ G* c# R. }   '……
, I0 |, w2 e% |$ a+ @+ a   debugstr.draw - q- U" K* ?* }; \0 o
Set debugstr = Nothing ' |- h) w* \7 j+ f
%&gt; </P>9 d3 I0 Y) H* c; q0 Y  P
<>=================================================== </P>" x% J. V0 F9 \6 @8 g
<>debuggingConsole.asp </P>
. s1 O, W- E' k  h<>&lt;%
9 Y4 n+ Q0 {* l7 Z) Y  w( `Class debuggingConsole </P>5 W5 |* [1 ]$ Z! n: `
<>   private dbg_Enabled
+ q) O$ q8 X0 M0 E4 k- E   private dbg_Show
- K3 ?5 _+ s9 l- |4 W: A   private dbg_RequestTime ; ]3 e3 z! S! Z4 t4 a4 l# T
   private dbg_FinishTime
6 f7 H# {* z. l   private dbg_Data
& I2 H6 M$ b$ T  g   private dbg_DB_Data ! w3 N# M5 M7 s/ k
   private dbg_AllVars + z, E' V) U: M. w' ~( o& N
   private dbg_Show_default
* x/ V6 ^2 I6 ^1 Q7 A% |6 @   private DivSets(2) ! [5 z* Y" b3 q9 n$ ?/ p% s
   
6 ]% B9 ~+ V" H# \% g$ F" h'Construktor =&gt; set the default values ! h5 v5 A$ X! S, E& d  B- W6 r
Private Sub Class_Initialize() 7 ~3 v, V# T# g' \, a! a: C7 F' \4 t
   dbg_RequestTime = Now() 3 n1 p! }: X" m! C" C; o6 n
   dbg_AllVars = false
  u6 D- A6 T1 {# M2 y   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
+ i: _6 @2 W8 G2 d! B4 z<>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>
7 b+ x0 J. s, `& B( W# i<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
/ [' R. z7 p4 r& q2 v( }, 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>
) l5 S! y5 H: f  b<>   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>
3 h2 d6 n  a* F<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
7 o+ P/ M. H, @; aEnd Sub </P>+ ?% q3 L" n! m+ ^+ O0 j. q6 c, `
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false . v( @; G7 Q4 B, R4 f
   dbg_Enabled = bNewValue
: `1 [3 C9 J4 S* z. eEnd Property </P>
0 v% s+ C  `& C6 \. m<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ' }% |( r3 t8 n
   Enabled = dbg_Enabled : J- n9 f* ]% U! F( `0 ]
End Property </P>
" |# Z9 e# b7 @3 J" T* 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 1 x* t( A" ^5 B
   dbg_Show = bNewValue + H4 ^" W9 |- Q! p! I
End Property </P>: r4 h- r% \% r6 k) j; d, G$ ]
<>ublic Property Get Show ''[string] Gets the debugging panel.
+ ~2 X6 S' d: A) z/ v! J   Show = dbg_Show
. ~7 y5 {# T4 z2 v; K" `. _End Property </P>
8 T8 _, L0 z& F& Z% ?<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false + E$ \7 I3 p: t3 K' W+ E+ N
   dbg_AllVars = bNewValue
( B$ f  y) C5 C2 C& a# pEnd Property </P>
8 `8 }/ |) F( r8 [. s. `<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
+ x  D: L) N. t   AllVars = dbg_AllVars
" k" P# w! N# c5 l0 xEnd Property </P># e3 e& Z( v* M: D" T* i$ H
<>'*********************************************************** + o7 r7 N: u* r# B$ L- C# i# ~
''@SDESCRIPTION: Adds a variable to the debug-informations. 2 q+ I( p8 }+ X% z  v, n9 z1 ?
''@PARAM:  - label [string]: Description of the variable & `1 k% h" B0 Y  [  s
''@PARAM:  - output [variable]: The variable itself
3 W5 G8 M4 E6 Q8 t'***********************************************************
0 M4 `2 z% {; D, MPublic Sub Print(label, output) ; w! Z5 [* M) Y
   If dbg_Enabled Then
! F2 _5 L2 R# H( j4 b. K     if err.number &gt; 0 then
! l0 q% u" m. w9 l0 B' G; t       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) , T2 [; l5 I. L& `
       err.Clear : w5 Q) f% `# ^6 V* K( C
     else 3 r! C* m1 I8 b
       uniqueID = ValidLabel(label) : E) z  W+ |. _
       response.write uniqueID
: _9 |  L8 |. y# v       call dbg_Data.Add(uniqueID, output)
9 C0 M, h+ R, R     end if 9 M/ d6 g  P$ I6 \- `
   End If
/ n8 e) w/ Y" y% j2 R& y2 |0 X: UEnd Sub ; Z; `; ~) O: T! @& |, F
  
5 H: T4 s" R: ^'***********************************************************
9 I" X' W$ B6 H! z'* ValidLabel
& ]- z' r6 r  ?% K'*********************************************************** 6 A2 M0 N  y# H8 ]6 W- \6 _' }
Private Function ValidLabel(byval label)
! S; i6 K4 K" J+ T3 I5 O   dim i, lbl   c' w4 H0 v% d  C* Z5 w% r
   i = 0
* C" B1 @% \9 ^! R7 z/ |   lbl = label 9 e9 y8 B$ r' N. ~6 l$ M
   do 2 Q) V; p* m) ?4 h7 o7 o
   if not dbg_Data.Exists(lbl) then exit do 4 `. H$ K% H  I4 p  c
   i = i + 1
! H& [& u* V3 J- s( ]2 ]* b   lbl = label &amp; "(" &amp; i &amp; ")" # H) B. R- D  s  @
   loop until i = i
0 z$ O1 Y3 i' h' y; R  ) c* u, y1 H1 p
   ValidLabel = lbl
' H5 ~( b) Z! V& `  Z, @End Function
  z6 k; w, B, E5 ^: j& V0 }; e  4 ~# a+ j7 a+ |/ Z% b! \
'*********************************************************** 8 Y! C0 X0 n- m8 w8 _
'* PrintCookiesInfo & R( \4 l/ _9 T
'***********************************************************
& I0 e: n% t; @6 k4 u; W  sPrivate Sub PrintCookiesInfo(byval DivSetNo) & b, p# D0 K0 `3 k, O
   dim tbl, cookie, key, tmp 2 A3 Z" \$ I- w8 p
   For Each cookie in Request.Cookies
% l3 y9 B3 }8 {& G) {1 q   If Not Request.Cookies(cookie).HasKeys Then 4 B& N! C) w1 E! X" v3 U1 @1 K
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   " U. X* y1 @3 o4 W# B( P6 T
   Else
6 f6 v5 w. y* N! S+ H     For Each key in Request.Cookies(cookie)
0 c9 K2 m! L  K     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
/ h( N. l7 a3 ^7 Q7 YCookies(cookie)(key))   / c( T! J" A; U+ E. E
   Next ' `0 C) O5 |5 g6 j
   End If
: N- p  J+ o' X: t4 C   Next </P>
9 i( q, d& Y" h# O# \<>   tbl = MakeTable(tbl)
* A: \6 W" q2 q/ z& i( [+ U6 N0 D7 u   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 8 C5 l( Q2 I1 |5 B
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
* r7 R3 ^# h' s+ X   Response.Write replace(tmp,"|", vbcrlf) 7 o$ |# P9 A& G. K( Y$ A, y! x
end sub
, P& U/ c* @9 L- p* Z  
! L2 M8 v, T, c4 R' f  ^: O'***********************************************************
/ M: C4 b# p1 w4 W+ i! r1 `'* PrintSummaryInfo ; J) ^& C) N7 O- o
'*********************************************************** ) a! m6 k# x9 G& ^4 f6 m
Private Sub PrintSummaryInfo(byval DivSetNo)
6 t/ F! ?* S/ N' ?   dim tmp, tbl   b' U7 z. B- w9 R
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 4 q) m0 v* z& e9 X' t+ i' _
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") $ w; @% h- D# E- k
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) # k4 K# Z9 [+ K$ e4 |# j
   tbl = AddRow(tbl, "Status Code",Response.Status) 4 A+ {% M7 T- e% Q+ k
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) % u: C" v) A- V8 \1 N* S
   tbl = MakeTable(tbl)
% z+ i/ h+ v, |$ L# C/ g' C# x   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 7 s* s& w3 _; ]
   Response.Write replace(tmp,"|", vbcrlf)
* f' d% R8 y) u& H6 g+ NEnd Sub </P>
# j" {+ R: M' N: R8 b* o4 K<>'*********************************************************** / N" U# t5 f2 \: k
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
+ d3 B+ `" V  V( c''@PARAM:  - oSQLDB [object]: connection-object
" {6 F+ Z! q% m# v# F'*********************************************************** , H% b1 m  e( V
Public Sub GrabDatabaseInfo(byval oSQLDB) ) J* m. U. }% P2 J! p
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) ( |, z% b, ~" i3 ?
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) " }: B) T& e# \- W; y2 L# S. g+ L' X- `
   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")) 9 p+ [0 V" S* Y2 v2 x' Q$ d& C
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) , ]' ^3 X) ^6 ?/ w) N  V0 ?( G  Y
End Sub <>'***********************************************************
1 F# l- Z7 Z+ h8 ~'* PrintDatabaseInfo
! M; c# ~2 N5 v9 W! K'***********************************************************
6 B( H" ~9 ~; l, K. a3 W# WPrivate Sub PrintDatabaseInfo(byval DivSetNo)
- [- y) o& K6 u. P* z3 O7 a   dim tbl + I4 ]5 q: t2 E: o/ i- `% `
   tbl = MakeTable(dbg_DB_Data)
* i8 Y" r& `0 p   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 2 R, r0 v# D& c& ?3 r; Y, J
   Response.Write replace(tbl,"|", vbcrlf)
% S# n6 L& q% B- \End Sub </P><>'***********************************************************
& e" U, Z5 C  b4 X! @" F5 B4 b9 b/ X'* PrintCollection
. x  G( g2 ]7 j5 A0 F* q2 `" y'***********************************************************
  ]5 b+ N& h- J5 {3 O- b5 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
( C  K9 s. n  {: p4 c; n   Dim vItem, tbl, Temp 8 D, z/ p3 c8 B4 L$ v# P, o/ T
   For Each vItem In Collection
9 y& ^) i& h) k& x) B+ G0 i/ H9 K2 u     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
( l4 [5 D9 s: k% U/ A       tbl = AddRow(tbl, vItem, "{object}") 0 d, ?- i( ?5 a7 y/ _) h
     elseif isnull(Collection(vItem)) then ! t: ^+ d( i8 s' \* }( z
       tbl = AddRow(tbl, vItem, "{null}") ( ~/ r% l3 [1 l: s% }
     elseif isarray(Collection(vItem)) then
  L$ t/ L2 W  j8 y       tbl = AddRow(tbl, vItem, "{array}")
$ f$ J3 j" a9 Y. j0 p     else
, T& [/ l" m$ z$ F) z7 `       if dbg_AllVars then & ?8 s! l9 }* @4 s
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) / v' h9 v  v5 ]+ j5 u( j
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 8 ?, p1 L) K2 k$ U
       if Collection(vItem) &lt;&gt; "" then . ?4 J2 S& _$ C! P
       tbl = AddRow(tbl, vItem, server.HTML/ F, a) z( c* [) H$ t' M# r
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
1 @' g" |: I8 i) D' E4 v       else
, V9 o1 L- p; ~" W. s       tbl = AddRow(tbl, vItem, "...") 8 f; m: G/ i) G9 \  F8 S
       end if ' R  v1 h  u% o$ ], g+ c
     end if 2 I: D; N( G/ M1 @* }% b! a
   end if $ {# y1 I; @5 d* V
   Next $ G" N$ M; G  ~* R; }: f" h
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 6 R: b$ v4 g' G( }' U
   tbl = MakeTable(tbl)
  `6 f# r; D' c" n6 h   if Collection.count &lt;= 0 then DivSetNo =2 : h+ L( i" ?8 ~# b+ D
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 1 P% e9 ^2 k! Q1 @' c
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% p. g; `/ V+ I+ c     Response.Write replace(tbl,"|", vbcrlf)
9 I1 P5 L9 h9 G! i6 @8 d6 p8 rEnd Sub
8 w7 c! U% Q. ~  7 U$ Z3 j# t8 G, `8 F5 S
'***********************************************************
3 q, x$ ?8 o, f% o'* AddRow 5 Q8 {" C' {. w
'*********************************************************** % O1 r- b2 _  ~2 h: Z' I
Private Function AddRow(byval t, byval var, byval val) # ^+ v* U2 Z  d' F. {
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ! [" d+ s+ B2 N7 _$ \
   AddRow = t 4 b( s( B& x; e% q
End Function </P><>'*********************************************************** ( |! A* P9 `7 t9 I+ Q
'* MakeTable 8 W, w, j: ]/ V' d$ ^, h- K) E
'*********************************************************** 0 R7 T0 x' t4 {$ w( H: H$ g" Q
Private Function MakeTable(byval tdata) - h% h# f3 J0 e' A4 l; ?2 n' Y
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
* l5 `  J( h9 V- J: l; ?   MakeTable = tdata
4 \& m4 E7 j6 z; R9 R) |End Function </P><>'***********************************************************
0 \7 Y5 `. Z; [3 v% L''@SDESCRIPTION: Draws the Debug-panel
! E- _$ H. R3 D  ]* A- X. X'*********************************************************** ; P$ L0 N/ g4 Q3 ~
Public Sub draw()
. ~  J5 [) D) S# F6 v/ s   If dbg_Enabled Then
( F. d3 S) f, k4 k     dbg_FinishTime = Now()
; s) M$ a1 k  m$ p9 ^  " X. B; ^+ W# T; }8 X
   Dim DivSet, x
" o7 k. ]6 x% b' Z: v" M   DivSet = split(dbg_Show_default,",") ; m9 b: O9 N& u4 E$ Q- H
     dbg_Show = split(dbg_Show,",") 0 Q3 W% L& y6 M: ]0 S
  , B0 z/ y6 q$ h& M5 B1 |9 j4 O8 P# O! ]
   For x = 0 to ubound(dbg_Show) 9 t$ }& d! [9 }8 M- y9 ^8 z. _& S% W
     divSet(x) = dbg_Show(x)
% L- @/ k7 i) b- V8 s" f% V   Next 5 {* @' P, o# w* p( j4 k% [' r5 _6 v6 t
  # c; }2 k3 j7 c' i% s7 V6 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;"
" G, f. A/ [1 K   Call PrintSummaryInfo(divSet(0))
$ `! L8 G! E# |$ @9 R; C     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") # E' X" H  E) N( _; R
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 i* F# P0 v# z$ d( k
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
$ |2 H, f& j% e  S8 ~    Call PrintCookiesInfo(divSet(4)) + r* L( R4 B2 d( B- 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))
" Y  i& D9 b& ?. ]. R! Z    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . P7 n- a) u. @( Y# Q3 r
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % w% g/ b) ^; T% m2 [$ ]
    Call PrintDatabaseInfo(divSet(8))
9 Q  V: p) U8 Q8 I% A9 y& u    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- @; k3 E$ R! `  N; p9 @    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 H1 _( `' n2 p  V
    Response.Write "&lt;/Table&gt;"
6 w# X0 C( D9 B) f7 _   End If ! ~) O; S  V9 e( [$ U% N9 [2 {. g
End Sub </P><>'Destructor ) Q$ J& J  C( c$ G$ y  e: m
Private Sub Class_Terminate() / y3 e. W7 E4 W) U5 |0 T3 Z+ `
   Set dbg_Data = Nothing 4 p! @; |" V8 u3 O+ S2 l
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 i9 m2 }" r1 S- G2 lCLASS debuggingConsole
; T4 {$ r7 M, Q: s! |: P9 tVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' L: u% i* k' E( i3 Z&amp;n. F. _1 V+ F% g4 l, V- z
bsp; 0 u, w# p" y4 e  \8 {7 g; t/ q0 t
Property Get Enabled===[bool] Gets the "enabled" value 2 o  Q9 {9 L3 L
  9 ^2 A: _) L. I  p8 y' _
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
; ^, S1 z. D7 }    {2 ], G0 t( L8 u
Property Get Show===[string] Gets the debugging panel.
5 f6 C7 D1 h/ ^- v3 w. l7 g" L. z  
3 t! ~7 r  @9 M( [* f+ y1 N' KProperty 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& N$ J3 G9 F" _Public Methods </P><>public sub===Print (label, output) % i1 Q; D- e8 _$ s' C
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ' ]$ z* Z4 P1 X, Q! e
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
( s& ]: J/ h& M  z( z  J   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
& T. {2 C+ G5 H4 T( ]9 aMethods Detail
; K% y3 f' c! \' [5 {' ]2 b2 H, l  1 e! j, i( J% V. u
public sub===Print (label, output)
5 R; x' c  S" C$ `- b" ^  u8 PParameters:  
6 ?7 j* ?# J8 I' m1 M( |' E   - label [string]: Description of the variable + a# F" E( P, q
   - output [variable]: The variable itself ( b6 V; e% _& U4 A
  ! C% }& m9 _% [; a  }
public sub===GrabDatabaseInfo (byval oSQLDB)
  b$ A# }( d! \1 J! U" rParameters:  ) ]: \' o* G/ j) r8 b( 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, 2025-7-17 11:33 , Processed in 0.407851 second(s), 56 queries .

回顶部