QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>' G" ^7 O) y6 {9 Z2 V( s0 G! t/ }
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
2 c/ N2 u; _; d$ R$ y使用方法很简单:   a( J5 F7 T  X( A3 Y  h
test.asp </P>4 p9 o: m' |! M$ i  s
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
4 ^! w* g2 w+ J% o- D- |8 e5 ^&lt;% 1 E6 B0 p& J! X
output="XXXX" $ @: z% k2 D. u1 h4 {
Set debugstr = New debuggingConsole   I$ c. K5 Y6 ]1 D- `; K# T
debugstr.Enabled = true
) H  s( S! c' u0 U% e; N   debugstr.Print "参数output的值", output
1 y$ k) _( ~6 I$ L' e7 A   '……
! T& y$ I( b' J* K. |7 x6 q% K   debugstr.draw   p- s0 Y4 ~0 S; G
Set debugstr = Nothing   j# `; V  U- \& v% v+ A/ s' g& j
%&gt; </P>
! M& |: R$ f5 W2 j& c/ U, c& L<>=================================================== </P>4 [. s$ I9 h9 ?) h; u
<>debuggingConsole.asp </P>
5 K0 v( p. q  A8 ~3 q. \$ y; ~! q9 ~<>&lt;%
4 N. H7 _. n) i. l6 x5 n( U- ?Class debuggingConsole </P>
+ I! p8 W& d- M- `; Z) ~<>   private dbg_Enabled
. L* E6 y, w5 [& w   private dbg_Show 2 ~: I# E" n: Z% ^$ d0 J
   private dbg_RequestTime % e5 E% c6 I$ W( ^2 V  \8 q; s
   private dbg_FinishTime $ F" }2 j9 f3 y  a5 E$ F
   private dbg_Data % m* b% l& n6 N% O. R
   private dbg_DB_Data - x! d  r6 o  D
   private dbg_AllVars $ Q5 E$ @6 G& q3 n9 }
   private dbg_Show_default
7 \3 k5 \  J& E1 ~   private DivSets(2)
/ m8 A3 ~" c. Y8 q/ c& ]   ; C7 x% R0 I& A1 z6 Q
'Construktor =&gt; set the default values
6 N! z* z; D1 J2 _( Z2 O0 lPrivate Sub Class_Initialize() : s5 C( W- r9 a& g% Z
   dbg_RequestTime = Now() * h0 H. p% K( n
   dbg_AllVars = false
/ s8 |7 A) T- a! D( D& h7 ?1 T   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
) @0 Z  }+ U' O1 K! T<>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>6 G3 {+ C! w+ k+ q- d0 \/ ~
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;( ]* l1 K0 H4 L- R: b
&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># e6 R$ U' {% w. Y6 U
<>   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>
& ?5 m0 g/ ?- R<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 6 e! r! Z: k# }# ]! P9 n  g
End Sub </P>7 \( o$ c% a+ W2 e- q
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
* w! H2 |) j" T0 \7 D   dbg_Enabled = bNewValue 0 d/ v- D. P5 a& e/ A3 G/ T% O
End Property </P>
( K4 p4 r% p% e4 Z% ^. s<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ) k( e# m( X! P9 |7 `2 Y
   Enabled = dbg_Enabled + I# _. |8 c9 X/ y( S9 i: h
End Property </P>
% B+ C  U' V% }$ k, J* Y: m2 b<>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 . b+ ~" X" r; j; s% [
   dbg_Show = bNewValue 0 T3 A. w1 f- G
End Property </P>! T# V* b& c2 ]4 r$ d7 ~
<>ublic Property Get Show ''[string] Gets the debugging panel. ( S. n4 E  T3 P
   Show = dbg_Show
. A% ?, h  L7 q/ Z6 |+ f# T; pEnd Property </P>5 A. u% `3 i+ z5 T
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false * k: m$ |' u$ b* G" f* f. `
   dbg_AllVars = bNewValue
/ r; w9 @3 u  W/ ~& S0 p7 CEnd Property </P>
% d5 f9 B' u0 P& [% T* f<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. $ c$ z# Q, H- ?; V8 e& J* b4 N0 n% k
   AllVars = dbg_AllVars # R, c8 _1 U- x
End Property </P>: Q$ F: x4 ]3 L# G+ K5 D
<>'***********************************************************
: E( H% V$ o* \( r) e3 I9 i''@SDESCRIPTION: Adds a variable to the debug-informations.
# S  A: F7 b2 w. v2 \5 u1 ?  Z''@PARAM:  - label [string]: Description of the variable
# z% K5 E: W9 G7 @: ~. S''@PARAM:  - output [variable]: The variable itself 2 u; _- D! q' q# t9 [/ [
'*********************************************************** - ?6 r7 _# I; }' I" d, @
Public Sub Print(label, output)
1 r; b  n! f) L   If dbg_Enabled Then $ t  v3 M5 {4 ~& H, V6 M
     if err.number &gt; 0 then
! i' w$ }- [' q       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
8 R0 u% s; h# w" Q       err.Clear
+ P' x5 l9 s' ?- T3 L! K8 c1 b     else " p4 Z2 |+ z8 C# P
       uniqueID = ValidLabel(label) : g: z4 Z; ^, V% u$ h
       response.write uniqueID ) J" N, ^; B0 F7 b8 Z9 B0 I
       call dbg_Data.Add(uniqueID, output) - A# g4 S$ `" |6 F  R4 ^0 T: D
     end if ! _& @( y, E8 L- R" ^9 C( ?0 M3 y" n
   End If
" C+ L9 k) r+ F) t. `3 H% BEnd Sub * u- w" I- {; `" x
  . l/ \! A" N* {2 q9 J) m5 _1 @) k
'***********************************************************
# }( Q: v2 I, i; b, M* c'* ValidLabel
. ?. }6 Y3 K5 }* P/ p9 _'*********************************************************** : S5 d% l" v+ x: p/ Z1 {- ^
Private Function ValidLabel(byval label) 2 I$ _9 _  L& C( d2 |: k
   dim i, lbl
! X; u7 }! L( R: F. Q3 I   i = 0 9 I9 b1 p' v& w2 ?1 P! Y6 O6 Q
   lbl = label
3 A1 I& h9 E+ M/ k# ?   do 8 {7 N0 n6 O6 w! i2 c8 N2 M  p* N7 {
   if not dbg_Data.Exists(lbl) then exit do * }9 Z4 `0 y$ d- ^
   i = i + 1 # }, v+ N1 D! E1 }0 U
   lbl = label &amp; "(" &amp; i &amp; ")" " ^! p! e2 `+ d* }
   loop until i = i   {8 |8 q* N) E+ w6 u; w9 |
  
4 H# T: F' ]. M  {" n+ K" _   ValidLabel = lbl 3 U0 h' m- l% {0 o+ p" ]9 @/ |
End Function
7 d* L# R' T0 t; i+ u; Z3 y  
: i  z* G- n  d4 D'***********************************************************
9 ?1 L/ e) t) w0 r, \! u/ l'* PrintCookiesInfo # h, ~* c( ~& t' I( N
'*********************************************************** 1 s; Z0 P  Z, J
Private Sub PrintCookiesInfo(byval DivSetNo) ; w: ]0 P2 y$ i- m
   dim tbl, cookie, key, tmp
9 _" X2 E( s5 d/ w   For Each cookie in Request.Cookies
' L- B5 T3 I. D4 \6 L  n2 V  n- D- \# e   If Not Request.Cookies(cookie).HasKeys Then
& G# F' `9 f0 D; \, l- C' U     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   9 y0 h4 V$ N( N4 l& G0 P
   Else
+ E! ^% g6 N( u6 J8 X% V( T! p     For Each key in Request.Cookies(cookie)
! ~( M8 h6 E% y6 w# f     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. / J8 K) n# F& I# x
Cookies(cookie)(key))   ; ~- X. `& k5 L0 t6 d
   Next - E. C. N! O9 o! H( W3 ?
   End If
# W4 f1 S5 T8 l* ?! }4 K( n9 _   Next </P>
3 @. j( Q+ h0 z. _<>   tbl = MakeTable(tbl)
" Z+ s+ a3 W. }- l6 S   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 % X: q8 n* |5 {* W( O- r/ U+ \2 q
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) / E# X3 k! h: {1 K' q: ]
   Response.Write replace(tmp,"|", vbcrlf) " N* p1 y! I) L4 I2 y5 W
end sub 8 B( R0 {! g7 ^4 K/ q
  
; q. U6 ~3 R# o) i& ~, K$ m'*********************************************************** % ~2 c* d: m  [
'* PrintSummaryInfo
7 w7 b0 E" A! Y: ]  A'*********************************************************** * N! d  Z+ f' I
Private Sub PrintSummaryInfo(byval DivSetNo)
7 {; V) s( f$ u0 g- Z  @1 n   dim tmp, tbl . D! t* d& i2 m4 e7 _( H
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 1 A+ a8 Y2 h) f) d& \
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
$ u' Y. H$ B! c4 c, l   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) ; G" I; c7 r1 g; C. f+ H
   tbl = AddRow(tbl, "Status Code",Response.Status)
3 W6 X1 O( S: U  w4 g) }% t   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
- U+ z: c! N" b   tbl = MakeTable(tbl)
: h( E; ~5 O2 I+ L   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 0 }9 y; l/ ]: N7 }, ~% p
   Response.Write replace(tmp,"|", vbcrlf) 0 G2 z- c7 V- [3 J# D/ J% _
End Sub </P>  n; M4 B0 Z9 s9 h9 ?5 V& b
<>'***********************************************************
& g) U" c  j, `5 N5 i- Z8 }- F''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 8 k, }# |# L9 T) U3 v
''@PARAM:  - oSQLDB [object]: connection-object
% H+ I8 r, q( s- K'***********************************************************
0 Q( d. J) n" @$ S5 j! D( ~Public Sub GrabDatabaseInfo(byval oSQLDB) ; G& w0 Q$ m' o
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
  c$ k4 ~; ^- k/ @0 H1 O   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
1 h7 ]) F' N4 p   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")) , E: \+ D5 F# o' h. M3 E( X( O6 u
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
8 Y& T0 ~( }6 F5 IEnd Sub <>'***********************************************************
; m2 w4 d; _+ x. }/ ?% D  w'* PrintDatabaseInfo
: b6 s# c" m( p' H9 q% X'***********************************************************
0 K( A' \/ r  nPrivate Sub PrintDatabaseInfo(byval DivSetNo)
1 E& C5 B# V# S0 A3 P* n9 f   dim tbl . {: m1 l( ~% S+ x7 E/ \- V
   tbl = MakeTable(dbg_DB_Data)
9 i  m/ m5 N% x! F: h   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
) a. _1 H" c) z   Response.Write replace(tbl,"|", vbcrlf) & K$ Y& C" i* Q3 H: K
End Sub </P><>'*********************************************************** ; }9 b/ j3 `! m
'* PrintCollection
4 l% e: R3 q5 u% E'***********************************************************
  p1 M# j0 V* i2 D" _2 H5 mPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
9 s8 [, d4 _) @& K   Dim vItem, tbl, Temp : k+ q7 t! g( B  i* U
   For Each vItem In Collection ) e3 u& E8 k: }& i6 {9 t
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 2 T& y9 C) }+ d. h
       tbl = AddRow(tbl, vItem, "{object}") $ c' p9 q9 t/ ^; l
     elseif isnull(Collection(vItem)) then 6 k. Q' e. z$ T9 E$ r  u& _
       tbl = AddRow(tbl, vItem, "{null}") % j( q, W: W; K4 H, ]4 s
     elseif isarray(Collection(vItem)) then * I1 v/ I5 c. @) ~8 [
       tbl = AddRow(tbl, vItem, "{array}") . x+ k! k  u% s; {* _. b7 |" d
     else
6 j* A. T  d: J) }/ T5 @, S; g       if dbg_AllVars then # z/ W+ M1 r7 U
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 6 i9 d. K* u0 @3 M# l2 Q% v, a
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then & _5 J& Q+ g- R5 x; m; b
       if Collection(vItem) &lt;&gt; "" then
# e9 `& b. O5 U! {, o       tbl = AddRow(tbl, vItem, server.HTML8 x0 y+ Y4 t$ {2 f
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 4 n  @7 C3 w) u
       else - B" L: r: p2 {  M$ \
       tbl = AddRow(tbl, vItem, "...")   X2 v# _' R+ y  d$ T3 k! b/ J
       end if & U' z/ e6 I; K1 i
     end if
2 ^( t, z4 M5 @" O, G   end if
( F. b# p) T/ S. L3 N; z   Next & i; ^4 V" Y" S# U; H; L
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 3 {4 |, y9 ]$ q  a/ W
   tbl = MakeTable(tbl)
7 L- l  t. t& f2 A   if Collection.count &lt;= 0 then DivSetNo =2 , z* @  g# O4 z' y  D* A, E; F4 p3 f
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ( a3 H2 b( R& Y) c) d
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
( U; x0 T( ^& S+ B9 ?' v     Response.Write replace(tbl,"|", vbcrlf)
% X& K* H4 k7 n1 q. Y. w  BEnd Sub 5 c0 N3 r* ?5 R$ j: l) x: d! ]
  
4 R; f( ?) n* q6 o'*********************************************************** 7 N% J" Y# @/ [' ~
'* AddRow
& p7 U4 h. s4 a% w5 ^1 b0 p1 E'***********************************************************
; u- v9 U2 C2 d& K* t! kPrivate Function AddRow(byval t, byval var, byval val) 6 \! j% _& G7 H
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 5 Q( N: L- a9 u& ^" t( H2 \
   AddRow = t
' m6 N$ w2 v2 O9 j4 {End Function </P><>'***********************************************************
, ?7 W. y& o$ w8 ?! J: Q2 ^'* MakeTable
: _  m' A& @# w0 V8 E  o2 m'*********************************************************** + x  V2 |4 D% ]+ y" Y
Private Function MakeTable(byval tdata) ) F! L! }% t" p3 m4 p' q
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" * T: K4 o8 f) J" o" r
   MakeTable = tdata ' b) G7 _6 f# W
End Function </P><>'***********************************************************
6 Y6 H7 n( Z/ W5 J: _0 d' W''@SDESCRIPTION: Draws the Debug-panel ( N, n5 Z; s! K% h# c8 f8 s( M
'*********************************************************** 0 c5 \. _# _  T. _
Public Sub draw() ( m6 J1 i+ B6 U  U
   If dbg_Enabled Then
1 r8 \0 p5 O8 T& L     dbg_FinishTime = Now()
  s& S5 f* s* r  
' j# ~3 s5 m. F, Z   Dim DivSet, x
6 M9 z2 M4 U# e! \$ u8 X   DivSet = split(dbg_Show_default,",") % d+ @2 N7 I! b+ M8 B
     dbg_Show = split(dbg_Show,",") / D/ s7 {2 q2 J* }
  
% O, m: e; B; q+ n' L) p   For x = 0 to ubound(dbg_Show) / \4 ?" a* Q! r. M% C; b
     divSet(x) = dbg_Show(x) 7 W9 z  R3 P; ]8 D; X
   Next 1 c$ G& M; \9 M* o
  0 C5 x( @$ z! r* f0 N9 n. w
   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;" : r3 {" a; O1 G6 a6 r4 v) l
   Call PrintSummaryInfo(divSet(0)) 5 X8 o, P. \# R1 s: e
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( x8 N  d, M" i  x" ]) w# M) ~    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
) N3 J8 z3 K3 g; _% k0 ]( {% v    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
: V9 w* }2 F+ U+ i    Call PrintCookiesInfo(divSet(4))
% ~  U4 g) C1 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)) ' m3 P) M  V; ~# T! [4 h
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ A  i9 G8 S: a$ B    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . S) ~4 k# F" A2 \# D5 F
    Call PrintDatabaseInfo(divSet(8)) : }, \5 Q9 ?/ B: s" B1 O; j9 B0 X
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
& J7 F2 V+ {. U- T3 B, \    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") - O! L7 `# y3 W1 v
    Response.Write "&lt;/Table&gt;"
. @! ?" I, `# B   End If 2 r6 I& R9 M0 p
End Sub </P><>'Destructor 9 b. Z2 R6 B3 A" r
Private Sub Class_Terminate() ' V+ ^4 e; S- p2 l- b
   Set dbg_Data = Nothing
9 U2 E' H# k# b* X" A, zEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>6 [8 [( s  M6 C
CLASS debuggingConsole $ h. R' Z: `7 r; O" v; e+ x% C8 f* i
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
: z, b/ t# D" a; d8 Y7 [% C&amp;n+ W" o7 p/ U' @/ Z# d6 C
bsp;
  ?7 P, F# C& _9 j. wProperty Get Enabled===[bool] Gets the "enabled" value 8 a' N9 c0 P4 u1 `" O" V2 `$ J
  * [& T/ `7 v, {9 Z
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
7 ^: ?1 {) t1 v2 w7 |" K. Z5 r  1 u: G) i' @/ o4 ?  K* Q& [6 _) o
Property Get Show===[string] Gets the debugging panel.
# C" G& i. ]' z, M5 j4 P) r  
, {2 j0 R: O- `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! P  j+ q2 G  \Public Methods </P><>public sub===Print (label, output)
0 _) u0 ]/ e5 I3 R   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
% O% P  |' k+ Y   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 6 H% f1 f  O0 u, a/ I( x$ t
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- . C6 i* g6 t, e+ V8 e6 ^8 Q7 F4 V1 j
Methods Detail * e8 f" [$ Z- y0 V) V( z  E
  
8 T0 n4 q& r0 I! }/ {9 d- ^public sub===Print (label, output)
) ^1 l( z  R, m" M- tParameters:  % J9 M4 z/ N- g( i4 L/ ?; X. I
   - label [string]: Description of the variable / ~# N+ \0 f! b5 O
   - output [variable]: The variable itself
3 q8 j% i3 G8 Z& p  
. D: K  e& j' d4 _% l3 Bpublic sub===GrabDatabaseInfo (byval oSQLDB)
) l1 ]/ k7 ~$ ]8 N1 uParameters:    L4 d( j; \. x9 M3 u
   - 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-12-12 10:42 , Processed in 0.655588 second(s), 56 queries .

回顶部