QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>) s9 E8 f4 f% n. j
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
, _" D" c# i- `+ R0 b使用方法很简单: 7 I  A" O9 ]6 Z& |1 @7 ~7 f
test.asp </P>* G+ ?+ T, [( M! ^4 v1 k
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
$ H( c6 B* v4 r3 g2 d* C&lt;% ! b- w, w" G( h3 t
output="XXXX"   n2 x9 Y0 m' @% E9 m* i
Set debugstr = New debuggingConsole , D2 A7 ?- p3 C- s, \/ }- M
debugstr.Enabled = true
$ s! A+ G/ v; _: i; [   debugstr.Print "参数output的值", output
  [8 z# O6 L5 _3 j   '……
7 e  G; Y7 Y( E8 p   debugstr.draw
  |* ]3 x4 Q3 H8 n* R% |" L' }Set debugstr = Nothing
7 E: ]1 E% g& }' w* S%&gt; </P>
+ n0 U6 L* p4 V, @2 k<>=================================================== </P>
% p7 m; C  ?  O$ J8 A1 J<>debuggingConsole.asp </P>( A: c, D( k+ v2 [1 ^2 u
<>&lt;%
2 Z5 j" q+ w% x. fClass debuggingConsole </P>' G& M; k% z3 L0 K& w
<>   private dbg_Enabled 6 `) J0 z0 H1 s+ N) m' u. w
   private dbg_Show + S# o1 m, s) f( o
   private dbg_RequestTime
% `9 `2 |" y* K0 l4 f   private dbg_FinishTime
- V# P( @$ U' @. n  u; S% C   private dbg_Data / R, Z! O" h# t# C7 R# [6 E
   private dbg_DB_Data
7 {! s! y4 I7 y, ~   private dbg_AllVars
+ S, ?, ?9 l& J8 g+ q* R4 a   private dbg_Show_default
8 V; b( ?4 {, F2 V6 @* }5 \' \   private DivSets(2) + _7 Q6 V0 G" Y7 d. X0 y1 o
   " K9 Q" x# Z5 ]9 i2 \
'Construktor =&gt; set the default values
* ]1 z1 A+ k  S2 oPrivate Sub Class_Initialize()
) H2 m4 }" n( `' |6 s* r   dbg_RequestTime = Now()
: l, A! f) J' b   dbg_AllVars = false
2 s6 ^0 ?5 x0 z* z0 ]" Y, L4 X   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
! Z  j4 Q+ B" L1 F<>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>
9 }7 y+ b" g+ g& m; V' N6 R<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;& O- y# H. H) 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>
2 C6 k1 Z. t2 F<>   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>
1 D! P- f$ `1 U<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ! h& J, _1 S* d! E4 c- u  ~
End Sub </P>
$ p% g$ H  |: O- H<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ! [4 M4 ~% _5 q( T4 f, H0 m: R- q
   dbg_Enabled = bNewValue 5 {8 q7 C' G9 {
End Property </P>' \! T$ F' O+ |1 B# W
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
# n, G1 E. A: E/ a! M0 A+ V   Enabled = dbg_Enabled ; S- x' t6 M4 f  ^
End Property </P>
: R! ], W$ K$ ]' F  l<>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 / t0 z- _7 g* w; e
   dbg_Show = bNewValue 7 X! v' Y% }/ w! j: n- C3 U
End Property </P>" W" H; ?# R" O7 |- z9 a) f- l" Y& b; B
<>ublic Property Get Show ''[string] Gets the debugging panel. / S- d( x3 P  j- J/ }* j
   Show = dbg_Show & W+ _3 [, W8 a/ X4 [! G- v
End Property </P>
+ P1 a- Z. U, {% J- ~" ~( {<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
7 z7 ]# c- i/ }0 r   dbg_AllVars = bNewValue & @! Z5 U( C8 U+ k6 e6 s
End Property </P>
# U) U' Y7 g9 t9 y- j" n& l  s/ k<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. , k: Q2 n+ x3 r; A! B. W( a) E
   AllVars = dbg_AllVars
/ h2 x* C" }' _/ z4 EEnd Property </P>
8 ~: N* ^# P2 S; T<>'***********************************************************
* W$ f3 l: z7 ~: X''@SDESCRIPTION: Adds a variable to the debug-informations.
3 c2 q; C3 X$ G0 j9 F: u" i''@PARAM:  - label [string]: Description of the variable 8 N" K, w/ \& e. V# ?) ]( b. O8 p
''@PARAM:  - output [variable]: The variable itself : T8 s5 u9 r! S$ f
'*********************************************************** , {" E/ K5 j3 K5 C9 L* D; M
Public Sub Print(label, output) % |0 r0 q6 |) g9 s1 ?
   If dbg_Enabled Then
4 L" D8 J9 I2 w; {4 w4 u* s7 U3 I     if err.number &gt; 0 then
' l* Z8 v9 H% h: h0 A* \2 j       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
* H$ B* B) Q0 t3 z6 L5 n       err.Clear
. u3 F7 N  G# K( R     else 2 Z  b5 \! b" U+ s
       uniqueID = ValidLabel(label) % u6 s7 k$ c& B7 L+ D/ Z
       response.write uniqueID 6 ]2 n% q$ I  z
       call dbg_Data.Add(uniqueID, output)
- ]1 m0 s$ |$ L+ Z3 Q& M; L     end if # P! l0 J1 V: X, f' I
   End If / q, |2 \( P0 K' i
End Sub
4 Z8 D  {  \' f* F  
2 F2 m& H4 N1 z5 o, Y& D( M* q7 C'*********************************************************** 1 {% v; O- r3 y8 ?+ `) D
'* ValidLabel * q) G9 B, R# l) ~" j/ V- p
'***********************************************************
" I0 ?& k! x: K3 E/ @9 B  wPrivate Function ValidLabel(byval label) / T& D7 ?7 w5 J! H  y5 l# r
   dim i, lbl ) ?/ S% v6 U" S: q
   i = 0
; c  X/ o/ c* A) e5 s4 F% J# A   lbl = label ; q+ M) E. H$ r, }6 t( m- {
   do % M+ J# Z; k+ F) s: \+ d- P
   if not dbg_Data.Exists(lbl) then exit do 9 E# P7 T& k+ C: Q; U) R# k
   i = i + 1 3 O. |- v  L; J2 @1 a8 o
   lbl = label &amp; "(" &amp; i &amp; ")" ; {5 \, `* N; h: j2 K
   loop until i = i
2 l! \. a. W8 i1 c  
( z# U. K6 c/ ?6 J- O( |   ValidLabel = lbl
9 i% _, p, Q2 [+ }% J% mEnd Function 6 K. c4 G( Q  F- t* ^- q/ d
  ' Y1 i3 Q3 K. e/ l& V/ i/ h; p
'*********************************************************** ( I3 t3 M  S0 ], q0 e
'* PrintCookiesInfo ; n( Y2 B! r  j
'*********************************************************** 5 Y) y( b' d0 j' v# w5 f
Private Sub PrintCookiesInfo(byval DivSetNo) ! ~! V! B, {2 O: p* E% t
   dim tbl, cookie, key, tmp
  C4 I. A! \: b3 |4 G   For Each cookie in Request.Cookies
& l5 E2 h3 Z' N( J! o. ?4 @& \  q   If Not Request.Cookies(cookie).HasKeys Then
. z' z. I7 c5 o% c& Q/ w: s     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
% {3 P1 O) q8 o+ w8 h$ B* G   Else 8 g$ T+ u4 B. K$ i& a% d( X
     For Each key in Request.Cookies(cookie)
9 e7 L* n; M( B) r# D0 D     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
6 K" P- s( b4 k, R+ \' |, D" jCookies(cookie)(key))   " Q) r; _) i# P% o; c
   Next
- t, R6 ~2 ?* |+ F/ E: G1 S   End If
* a# B& i9 _! v( P   Next </P>9 G* W3 o+ [! g5 O0 l9 G- M3 g5 V
<>   tbl = MakeTable(tbl) 5 Q8 o. y( w5 L0 c0 z& q1 }
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
) Z3 e1 h$ O# j9 h   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 4 S6 P$ _1 h0 G5 A+ r
   Response.Write replace(tmp,"|", vbcrlf) " J  U; e5 m, W* c, O
end sub   @- n6 u, @# H* @
  
2 G. G3 |8 d; l* G'*********************************************************** , M+ M$ r. b( J, a$ o, G1 S% g
'* PrintSummaryInfo
  I9 F3 J2 ~6 T" v'***********************************************************
' ?. j: f* P# U5 fPrivate Sub PrintSummaryInfo(byval DivSetNo)
) {/ j: N2 l8 A! J; o2 r   dim tmp, tbl
8 s. X' O' q5 p; w2 I. O   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) # X- T/ P# ^5 A& n4 p/ Y5 K4 a
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ! L& j4 Z8 I' G7 q( _. p3 ?
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) # S* y; ~: {% F" ]
   tbl = AddRow(tbl, "Status Code",Response.Status) $ c! Z2 m# j- c  V) K7 H8 v7 a
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
7 A% v- g' I3 ?   tbl = MakeTable(tbl) / X- e2 n8 L4 d* {
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 6 v/ u2 i; X2 H  h7 p
   Response.Write replace(tmp,"|", vbcrlf)
- |8 g- m3 I% z+ x! z$ H* S0 `) ?: XEnd Sub </P>
" q0 }  {4 u' u0 D6 a8 x<>'***********************************************************
) z5 S2 O# U0 A* [* q" m. x''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
9 V- c0 @* v4 r1 u, W0 `''@PARAM:  - oSQLDB [object]: connection-object 7 t7 G% @7 l3 P) i( v
'*********************************************************** $ f# D4 C, ~+ \! z
Public Sub GrabDatabaseInfo(byval oSQLDB)
" r4 |9 Z) A/ v3 y# a   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 9 f) ~+ P8 {: q0 i- E
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))   x7 ?2 z! z% o- W, n! P8 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")) 9 A% C. s8 ~$ e& J6 W7 _3 `) B% V
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
  k! g( p( s1 C  ?  F8 GEnd Sub <>'***********************************************************
$ P# h) }1 l0 i'* PrintDatabaseInfo . K9 u3 L3 o* b: R
'*********************************************************** . v3 b$ h. Z1 f2 f
Private Sub PrintDatabaseInfo(byval DivSetNo)
! i$ I; ?! f/ s$ o4 Z   dim tbl
  [1 h* F. u. K; H% m. c/ P- w   tbl = MakeTable(dbg_DB_Data)
$ x7 u, ~' Y3 G+ Q   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
5 A% k" f$ N& q3 ~9 ^   Response.Write replace(tbl,"|", vbcrlf)   \, k# t: T/ I& Z9 c1 `
End Sub </P><>'***********************************************************
; {$ g$ y2 w" m9 A'* PrintCollection 7 s2 N& k* d4 @$ ~
'*********************************************************** 8 B$ v  b% d( ?  {
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)   p# u% ?6 E, d
   Dim vItem, tbl, Temp
+ j0 J7 M/ A& I$ o) m5 t   For Each vItem In Collection % W0 r# Y9 `; v7 z8 e
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then $ }0 `( L" @; e) {2 |4 ^( V
       tbl = AddRow(tbl, vItem, "{object}") + n# s% T, H$ y5 t% U
     elseif isnull(Collection(vItem)) then . @" [; q0 z* q0 P% `8 ?* f
       tbl = AddRow(tbl, vItem, "{null}") ' r$ f4 o# j' C, E
     elseif isarray(Collection(vItem)) then
6 B6 O* V' Z6 J7 h! J+ R' w6 D       tbl = AddRow(tbl, vItem, "{array}")
& E5 s) b4 R9 o, e6 \+ y     else
0 [% r7 z2 {& t       if dbg_AllVars then / I" J2 O* Y9 R; L! o# I
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
1 g7 m5 B$ u, c# ?9 z* F& `     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ) q1 p, ?6 E" x% H; O
       if Collection(vItem) &lt;&gt; "" then ( X& n! ~; j+ ~/ U* O+ i
       tbl = AddRow(tbl, vItem, server.HTML! u) ^1 {) E, p4 I' X- O
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") - _9 }" D: z" P9 ]: H3 o
       else
  x  C$ r. y8 m1 u/ }5 r1 M( j       tbl = AddRow(tbl, vItem, "...") & \% h. A- t0 `# R9 o% h
       end if * X/ G8 G* P* _1 _% D. L+ R7 F
     end if
% ~4 b0 w% Z& ?4 a3 _  c  g; L   end if 8 W# E6 ?  k5 `" E( M  d9 A
   Next - O, l% U, F) m9 Q2 J8 X) U
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ( z6 _( z5 D# }3 r& f% j0 N
   tbl = MakeTable(tbl)
& o7 }8 N% }8 T+ V3 F1 q" ~" S   if Collection.count &lt;= 0 then DivSetNo =2
2 O. U" x/ P! T( v8 |- E- }% s     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ; P5 X: y& ~- u, h6 r
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) # f* e4 o. ~0 b. l9 k
     Response.Write replace(tbl,"|", vbcrlf) 0 x* @5 T, u9 h" ~( B
End Sub 7 l% s7 k9 ]0 ~, S5 I* v# O( |
  7 [7 S8 J" p7 ^% j" n- Y# g
'***********************************************************
' ?5 S  C; P9 A2 r0 H'* AddRow
1 V& J; s" L0 N7 j, s5 ~'***********************************************************   X' v7 G- f3 R( b& n) `
Private Function AddRow(byval t, byval var, byval val)
: A, W% s/ X- ~7 ~2 e9 w   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" . x: t# b" c2 i* p: h- a
   AddRow = t . w: z2 o3 y. H$ P# k
End Function </P><>'***********************************************************
4 y4 r4 F) F1 k4 @3 f'* MakeTable
1 o8 i% \1 h& v1 C'***********************************************************
, ~# i0 h& A+ c/ _1 F6 k; j  ]Private Function MakeTable(byval tdata) " W0 c2 m6 R6 J. O& j
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 1 o% r& f" }3 J' c2 ~$ g$ T; ]
   MakeTable = tdata & K; k! V) S7 G" {6 I
End Function </P><>'***********************************************************
- j6 n/ ~. M8 K4 i, l" ~''@SDESCRIPTION: Draws the Debug-panel
& m9 R5 r; n1 u'***********************************************************
' Q" b  [/ ~7 ~  YPublic Sub draw() 3 v( b7 k9 Y- s+ ?7 A9 J7 y4 k* U
   If dbg_Enabled Then
1 N3 o- C% d9 [( Q) Z! m- x/ P& x     dbg_FinishTime = Now()
! a/ y/ [. {% ?    R1 H: o2 k9 J& N3 ?) F/ S
   Dim DivSet, x ' X, O) w3 N( Y. L
   DivSet = split(dbg_Show_default,",")
; z5 z0 M8 y* r+ P     dbg_Show = split(dbg_Show,",") + X) k4 k: G3 o/ ?6 H
  / B9 x6 C  y# J# }6 L
   For x = 0 to ubound(dbg_Show)
5 q" y1 f# Y- Q# }7 w; V: @( `. c     divSet(x) = dbg_Show(x) ' h" l  R. h! r! ]' g
   Next
% J. H/ J2 |" E  
# _2 c+ `4 O+ H( u/ h   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;"
3 M% b! Y" M' `  m$ q   Call PrintSummaryInfo(divSet(0)) 2 K3 u& q9 ~  d9 D' ]0 h
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( r/ O2 R0 K- w( x6 ?+ Y" X# Z    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ) T0 D5 x7 U8 n; r
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
( B' h& K( U" w0 `! H    Call PrintCookiesInfo(divSet(4))
" [# \# u" g; E- v8 U# 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)) 5 @3 g8 V1 P9 c& ?( K' a/ V
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") : u" \8 z7 N  H; v( d
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# U+ A" {. N4 `5 ?2 m/ E3 G    Call PrintDatabaseInfo(divSet(8)) 4 n9 o& j' |6 }! {3 {0 I' k
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
# h3 c9 M3 V& Y/ x% H5 Z8 |    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 L; p( t0 M- \5 W  T* F- `
    Response.Write "&lt;/Table&gt;"
3 O: p; W2 v1 \1 \   End If ; m& ]& f+ S) S2 Y  L
End Sub </P><>'Destructor , g$ e" Q. B) i! t. @/ G
Private Sub Class_Terminate()
1 j1 M/ z; ~* ?$ z6 |# j   Set dbg_Data = Nothing ( j9 Q: a0 F. Z' |- o; ?# A
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
; k" _. h1 \% I6 X- b" YCLASS debuggingConsole
. f8 G: N+ c: U( Q; L, vVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) J/ I# o( _4 q0 ]/ W% r% R&amp;n' f9 J# u: q- b3 t8 M/ }4 |6 s
bsp; + p* W9 l! C3 {6 P5 k+ q$ Y
Property Get Enabled===[bool] Gets the "enabled" value
! h" ~8 |) h7 U9 c; F% p9 F/ a  {  
4 F; V! E* u& }9 `( a4 NProperty 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 & C$ E7 g0 t0 j
  1 F. {& v8 F1 K) D6 @4 g$ m1 G
Property Get Show===[string] Gets the debugging panel.
# F# W, d/ o2 r  7 W. Q% `  x8 U- Y+ k5 v- x
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><>--------------------------------------------------------------------------------
' {6 Y$ l8 E6 J1 D# aPublic Methods </P><>public sub===Print (label, output) : b5 l" H. H" L7 t/ Y; `+ o
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
3 g. Q; E. Y1 q& ~& `   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
$ [7 i2 f4 I& J* [) n, \. |   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ; k# b! g  u, l7 R* K
Methods Detail
5 g" b  g7 e" ^0 B7 k4 Y. z  
, a' s9 J1 ^& @9 r2 O) o- cpublic sub===Print (label, output) $ ]4 T9 A" h- i% M" N, [
Parameters:  - [/ t8 Y' _0 ?1 m, U
   - label [string]: Description of the variable
5 Q) T' G9 I* h, q   - output [variable]: The variable itself   n' {+ v! H/ ^* b5 Y: x. f# l" ]
  
( C& m0 O' @) U" l0 cpublic sub===GrabDatabaseInfo (byval oSQLDB) 1 c  H: v& F; x) z3 D, p9 x
Parameters:  : Q5 U% c0 x! S  r5 Q" p' q7 d/ C
   - 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 01:40 , Processed in 0.478757 second(s), 56 queries .

回顶部