QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
" y: z! Y" Q+ @! \<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
& y9 R  W6 I) n1 x$ I) Q* I使用方法很简单:
: I- I, B1 C: Wtest.asp </P>  F, l% W; R; ?  M* w9 e
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
: E: v) }+ t  D9 N% r; L% Y&lt;% & ^( s# k  K8 ]$ L7 T; S' n
output="XXXX"
& s) j; I( _6 P0 `2 W; \Set debugstr = New debuggingConsole
- u5 P8 o) x+ @. G! Rdebugstr.Enabled = true
+ R$ O' W. _9 n0 l% ^& l4 P; F3 x   debugstr.Print "参数output的值", output
- ?1 l4 ]4 m" ~( y/ w# |   '…… ( Z/ O' X  _. v
   debugstr.draw
: H0 n3 n2 K) Z8 [) KSet debugstr = Nothing + c( j7 o/ b% L5 R4 p( J
%&gt; </P>
* X, |# p6 b5 V6 }<>=================================================== </P>8 R1 i4 d: e+ y, o) |! ^
<>debuggingConsole.asp </P>
" z# f( `' P" e/ ^6 L, V% l<>&lt;%
" A- F7 n# M& R7 b6 y# F' cClass debuggingConsole </P>
2 Q/ s/ A8 Y0 y/ z' |<>   private dbg_Enabled : k0 Y8 b) S( c
   private dbg_Show
4 Z7 L) X* D2 p. f. r: x   private dbg_RequestTime . O$ [* N5 \  [- l9 j: D2 c
   private dbg_FinishTime
. h2 d) i# o; V( h* z9 b5 w+ F6 L; v   private dbg_Data ! f  k: I* Q3 c/ J
   private dbg_DB_Data $ g& Q9 @1 k, D1 d) z3 r: N$ B" T
   private dbg_AllVars
; s; E% E8 I2 U$ N# N; a6 v+ \   private dbg_Show_default
0 P7 d& t% E: I" h6 x" c$ K   private DivSets(2)   w5 N9 A4 @, v& [2 P
   7 E% T8 ~' J2 `7 {4 Z
'Construktor =&gt; set the default values ' M/ z& N5 U7 G! s, U) A4 l" y
Private Sub Class_Initialize()
; [* D1 b. {" Z2 D% F# r   dbg_RequestTime = Now() 0 r/ d* F6 B* ~  N. ^
   dbg_AllVars = false 3 v3 P, C3 i$ ~8 m( f* V* \- n- p
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
' v# ^. F3 D/ C! k8 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>
* j8 p4 B% x9 H# ?, J, l2 h<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;3 [* {9 T* y! w5 k
&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>
( M2 V* T7 K8 {( P<>   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>
& T* b1 Z$ F; w<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
3 S' p; {& Z$ u3 W% q& c3 W' cEnd Sub </P>8 a( R; ], I6 f2 t8 L" l
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
: v% J& T. i7 E   dbg_Enabled = bNewValue 6 L, D, U0 U# {, W/ j' C/ w
End Property </P>
  {  ]! ^  P/ `& G6 H4 ?2 b0 {<>ublic Property Get Enabled ''[bool] Gets the "enabled" value / g4 Y8 z; n, k! ^
   Enabled = dbg_Enabled " z3 n/ C. G# B5 v& ^4 D# w9 E
End Property </P>5 J" V4 T* J% n, x/ X( _
<>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
* a" o  t" M' h& c   dbg_Show = bNewValue 7 o% J( ~- ~' k8 C! L
End Property </P>
. T9 }4 p) E# [4 Z4 k<>ublic Property Get Show ''[string] Gets the debugging panel.
! G( n/ V) X1 u, u4 A3 j5 X3 J   Show = dbg_Show ; c5 c8 K8 y  K: p0 M
End Property </P>8 O( P, ^# ^- Q
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ' y% V/ Z9 I( c1 d
   dbg_AllVars = bNewValue
# q: O* ^5 |) T  j) Y  ]/ AEnd Property </P># f) `/ L) P# u8 b1 N, a7 M. C
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( E3 l$ o+ a$ r7 e- P* I  Z
   AllVars = dbg_AllVars
' v$ n: P9 A6 SEnd Property </P>5 u5 R( \. S( `9 S
<>'***********************************************************
" R' {* |5 k" i" f; O''@SDESCRIPTION: Adds a variable to the debug-informations.
/ y; ^9 x# V) q- U; X) h+ M''@PARAM:  - label [string]: Description of the variable
$ @; A4 f1 \5 x: w$ Z7 p2 m''@PARAM:  - output [variable]: The variable itself 5 G6 p- i; Y6 O( w; Q( K7 V
'*********************************************************** % r% M  p# I5 D# `
Public Sub Print(label, output) 4 ?, U; E1 q! L" Z" K* a* X
   If dbg_Enabled Then
! i7 n9 @1 k! y1 K     if err.number &gt; 0 then
& A6 Q$ C) r8 P' F       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
) K4 b: u6 h+ V       err.Clear
. K2 _' `5 b: A     else
; @* Y+ g. v  m& Q       uniqueID = ValidLabel(label) & m9 ]2 D6 T/ W5 _. _  ?
       response.write uniqueID
) {) l/ P( B: n8 s( L       call dbg_Data.Add(uniqueID, output) 7 b5 |$ n2 @9 D$ p
     end if , {$ B1 E! @0 U- [6 {  E
   End If
% r/ X% f" |  b! x: x, TEnd Sub 7 D( f+ X# Y! n( l2 e2 w  Q' C
  3 t1 n2 g! g' R  w0 e- A
'*********************************************************** 4 R4 t6 V8 g+ l2 t: U( p  ]# B2 `, T
'* ValidLabel
, x- W# O& N. y1 f1 j3 T'***********************************************************
& O! l& T2 h$ _1 h: ~" @/ R  V8 WPrivate Function ValidLabel(byval label)
" B" {! c: T- T# s   dim i, lbl
# j8 F% {! h& q9 _   i = 0 * Z4 V# E" Q3 M" b5 O3 t2 p
   lbl = label # l% [5 G9 E" @
   do
- h4 }: ]* {9 f# H: q   if not dbg_Data.Exists(lbl) then exit do
$ f) K$ X& D0 f   i = i + 1 8 l3 R; b6 b3 B, g) S4 U$ w6 `
   lbl = label &amp; "(" &amp; i &amp; ")"
( |8 R% A' e$ o2 q8 s9 |! o   loop until i = i . ?0 h) ^$ \" g+ c
  ! O& k$ T1 G  b# _) K; |
   ValidLabel = lbl 3 ?! S% c4 H9 N6 F
End Function ( r2 p9 z. i& B
  " a- c6 Z# @5 k; m  C
'*********************************************************** ; w: @  ?( B4 x. F, I7 [
'* PrintCookiesInfo + j' H, a9 ]8 x  Z
'*********************************************************** $ E) W/ o' W0 \
Private Sub PrintCookiesInfo(byval DivSetNo)
" n. Z9 F- [6 [- h   dim tbl, cookie, key, tmp * G/ i( I7 V9 H" ~) T# n' t
   For Each cookie in Request.Cookies
& g/ K1 ~9 K- B9 l   If Not Request.Cookies(cookie).HasKeys Then 0 Q, z" u" c; A9 F0 n- d
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
% W7 A* {' |; e# i0 I! ]+ F  ]   Else * d& D4 b3 J/ u
     For Each key in Request.Cookies(cookie) ) N5 G* g* s3 ]
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
3 m- Z$ E% Y% x( @0 O" mCookies(cookie)(key))   4 D9 j8 P2 i; n+ n1 S
   Next
' a) Z+ `7 C! v( p( ~6 P   End If
8 M8 y6 b2 R" i3 i! D1 m7 N% `   Next </P>: M7 Q; @# k2 |7 n; `
<>   tbl = MakeTable(tbl) & i& l* n. o0 ]6 `
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 7 S1 R2 }  M/ k9 y$ q
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) & c2 @  P) s) H+ Q
   Response.Write replace(tmp,"|", vbcrlf)
  h0 d' ^  r. U4 T) D( r3 I2 zend sub 6 ?; z1 C* v3 |% @) g! [% m: y
  % c# W. X0 d, O, }
'***********************************************************
% v. @2 ~% L% J+ [/ u" Y* k'* PrintSummaryInfo
* B( T; U. w* w- v* C! |'*********************************************************** ) M6 ]& O4 z; Z9 ]) g. D  W
Private Sub PrintSummaryInfo(byval DivSetNo) $ r7 s! d7 _: _$ f* J1 `; O
   dim tmp, tbl ' N. v% l2 l% V( y0 @' y
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ) A. x5 \; b! G) A+ {& }7 N8 v* B+ i$ O! a. b
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ! l, `) E1 Q+ I& ^: q
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) ' ~: A+ C, S% }  f8 A
   tbl = AddRow(tbl, "Status Code",Response.Status) # J& j, @+ f/ c: Q
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) $ E! A, @# G3 s' `
   tbl = MakeTable(tbl)
& v% T# O3 ], a( @" N, _, T   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 8 Y2 h; r" d- n6 o" A
   Response.Write replace(tmp,"|", vbcrlf) 6 R7 W0 H$ i8 \+ `
End Sub </P>
& |' W" H$ R: x9 w# C- l<>'***********************************************************
9 @; e4 ?5 V+ x( e/ I- U) K" w7 r& b''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
3 o1 \. j. f: U, Z''@PARAM:  - oSQLDB [object]: connection-object & w  L) I  L; P1 h* K
'***********************************************************
5 I. t4 c# q& Q- TPublic Sub GrabDatabaseInfo(byval oSQLDB) , Z* x5 ]% B; Q. B* B, ]
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
- b+ `- p* g. l& B' C   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 8 g; B, G  l; E! Y, ?( d
   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")) + b, j0 Y9 j  @
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
0 i5 V5 L% z6 ~5 rEnd Sub <>'*********************************************************** ( R+ i; ^2 w" w, V
'* PrintDatabaseInfo ) U0 _) f: A; L# Y" a8 i
'*********************************************************** * Z) |* `8 [3 ?, ?% d
Private Sub PrintDatabaseInfo(byval DivSetNo)
, g* r  ^1 ~1 K4 K   dim tbl . |$ u& o* l5 \7 Y7 ~
   tbl = MakeTable(dbg_DB_Data)
9 ?$ z, d: J( B  B1 m   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
! @. O$ n( V3 P4 b   Response.Write replace(tbl,"|", vbcrlf)
- B6 F' ]# ~! R4 D4 A9 qEnd Sub </P><>'***********************************************************
4 R) U3 g, p: M  c. y3 c'* PrintCollection
: a9 B' |- o1 a+ ^'*********************************************************** % d2 j# j1 U8 h' \
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; Z% j6 z3 _1 p' Y! M/ E0 c
   Dim vItem, tbl, Temp
8 D( U- m) ~: Q. ^, n   For Each vItem In Collection
3 L$ A0 @1 I  B1 |* z/ v2 _     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 7 b; z8 f: O" ]0 N
       tbl = AddRow(tbl, vItem, "{object}") - n4 r& I$ e1 v( Y3 o
     elseif isnull(Collection(vItem)) then
$ |' t$ z4 k( D  b       tbl = AddRow(tbl, vItem, "{null}") ; D! |9 _. r3 r4 b& [
     elseif isarray(Collection(vItem)) then ( }2 I3 }; |2 @" M8 z7 F. q2 O
       tbl = AddRow(tbl, vItem, "{array}") 3 K' \* P& h' q5 q* m( c+ m7 j
     else 8 t: {! |+ v8 O! z+ K; O
       if dbg_AllVars then
: J2 D( S: X% t2 B3 O$ V       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
4 {; M1 S" ]' K/ Z     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 8 C: |8 w7 o! i" T  W+ t  |
       if Collection(vItem) &lt;&gt; "" then 5 X. q7 H$ Y0 d3 A: l
       tbl = AddRow(tbl, vItem, server.HTML- s- J# a( E1 D) N) W! n! D7 \8 _
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
) m5 J4 j% ?4 k7 L) n       else
: M/ @+ l- I  i8 D/ s" x; B8 K       tbl = AddRow(tbl, vItem, "...") ' A* R) }' ?# h1 `
       end if 3 s# O; I! B9 t- [9 g
     end if % Q8 F7 k2 n) B) c, i) W
   end if
0 |3 R* p7 ]5 k1 X1 E8 C7 q   Next $ s' y9 A9 n; Z/ e$ |. t' t" ^
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ; v& S) v- m2 }5 O$ H
   tbl = MakeTable(tbl) 9 A4 u. Z% F9 h. y7 r
   if Collection.count &lt;= 0 then DivSetNo =2 5 r7 d& D* K$ m0 Q5 j* X
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 9 J1 T# O: M# R. V& ]+ o
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
1 c% v8 C! ?) d: c- O* l     Response.Write replace(tbl,"|", vbcrlf)
7 c" B' I" r" x/ b; I( @End Sub
: u. Y" K9 k: N- }3 i( x  % i9 A+ M! P3 m' G2 E
'***********************************************************
4 S* n2 M8 s$ [1 o! S'* AddRow
* R  S# _% `/ t  x. B'*********************************************************** ( V- _* a0 L0 ~4 O* O
Private Function AddRow(byval t, byval var, byval val) * w2 w+ T. Z1 F/ z  J' {
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
. W$ I  u, G7 K6 l/ ~   AddRow = t * Q/ A' `- M$ |& t5 W0 r
End Function </P><>'*********************************************************** & C2 X1 e8 c+ ]* q( ^2 |; R
'* MakeTable 0 [/ m8 o. P0 W6 N
'*********************************************************** * D. \: {2 E4 G  N  G
Private Function MakeTable(byval tdata) 3 n1 ~, ]5 _# R/ m# O0 B8 E0 A
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 1 ?/ z) u! v5 [2 t
   MakeTable = tdata 8 c5 @' [% ]/ `$ p; B
End Function </P><>'***********************************************************
* C! f% W4 \! S6 |- ^$ ^9 d''@SDESCRIPTION: Draws the Debug-panel 2 {; b7 U" O8 X: D
'***********************************************************
0 H" v6 |7 ?! B2 DPublic Sub draw()
9 u) B7 i4 q, _7 e3 P   If dbg_Enabled Then
' Y- `  z' t% N& f* b+ W* _9 d     dbg_FinishTime = Now()
+ f# p$ F* Z$ V' H( e& x  ]; A  ( m+ V, L4 X' K# U) V
   Dim DivSet, x
" h( y5 \  j3 k3 j; ~5 A   DivSet = split(dbg_Show_default,",") ( q. G2 Y8 o& F8 q% Q9 m
     dbg_Show = split(dbg_Show,",") 4 t2 h/ X+ j( G' V
  
5 z- ^- t  H' ]* q) [   For x = 0 to ubound(dbg_Show)
4 e. @, t7 R' E- ^9 R; c' G% |     divSet(x) = dbg_Show(x) + l) K- k5 p# b. t$ u
   Next
  q6 l" j. V. ]$ e  
) a, ]; f& ]7 p! |, V  @. J   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;"
- e# N# z6 m3 E7 H( M   Call PrintSummaryInfo(divSet(0))
8 c* R! E; f. X. n, J( p2 n* h# ^     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
' C" w6 K# {# Z% T    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- Y+ U# g8 \/ e* k# E9 @9 D- }8 @    Call PrintCollection("FORM", Request.Form(),divSet(3),"") ' X' n- Z6 e4 s" O! t. m/ x' _: G
    Call PrintCookiesInfo(divSet(4)) 3 z5 p: z) r: m7 L
    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)) , v, T" X  f. s- B  c( p* h. l, B
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")   e6 R0 X/ O* u3 S! h0 A  r
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
- g4 P6 L4 G: Z( p* w" v& P    Call PrintDatabaseInfo(divSet(8))
! r& G: \/ }: X" |& d6 Q4 X    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 4 [$ |" E9 b5 p: ?( Q, Y
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
; v7 A' ]' @: _/ A( x    Response.Write "&lt;/Table&gt;" # u$ [1 o( }% O& w8 y  P- k* z, H
   End If
6 k, Z% Q, I8 \* C# }; `/ ?+ fEnd Sub </P><>'Destructor + Z- @/ s, b# T  b% ^+ M
Private Sub Class_Terminate()
9 ?- l- |+ v3 w   Set dbg_Data = Nothing / G( U5 t+ l$ m7 C* Z
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
* @1 r; B# l' }6 SCLASS debuggingConsole
& ?. b: @' y* T5 o  cVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
  ^* e8 a6 `& [; V&amp;n6 b3 q* G2 d: O: D
bsp; ' B! p: }5 c! [# [* V" y
Property Get Enabled===[bool] Gets the "enabled" value
* o  s4 q6 b% t& K$ W, ~' n3 w  
8 c, n' l2 h% D2 Y: EProperty 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
  `! `2 f; A* L' k1 e! Y$ [  
# n# ^1 v  y, gProperty Get Show===[string] Gets the debugging panel. * G: A1 g: z: `3 Y, C! w+ D
  " G! @- j2 l; S( C- L9 T6 W7 V
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 j, l5 |$ [0 \Public Methods </P><>public sub===Print (label, output)
6 k7 k' W5 ?0 u1 O5 A$ u& |   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
( l& B2 H1 I" E! |' f7 g" e- r   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
2 }% j* T/ v* k( D( K  z3 w+ P5 q: M% t   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- - P1 U1 C6 T: M- W' ~+ O
Methods Detail " F' l. B1 u, [7 z7 _* Y
  1 V  M" ^# |" H" A
public sub===Print (label, output)
/ n% H# i2 j1 m3 ^" m  dParameters:  
% ^) K! h$ e% T- I   - label [string]: Description of the variable + ]6 s- K" R. P' \- b
   - output [variable]: The variable itself
8 |$ K( _# q& L9 ~; H) C  7 c' g! T, c  r0 ]) s: V- q
public sub===GrabDatabaseInfo (byval oSQLDB)
$ J* X! z$ w# V1 e. p3 \% `* G, `Parameters:  
7 v8 M4 L+ X3 i8 A" S   - 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-11-6 15:12 , Processed in 0.425419 second(s), 56 queries .

回顶部