QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
- t0 s) z& r& G<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! - ~4 R6 j! B; Q4 e
使用方法很简单:
" z$ M" u3 s4 Y9 f8 Ttest.asp </P># V8 V* ~+ G+ S5 b, V( x
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 7 s$ X5 b5 w+ N  y+ h. i
&lt;% + W( C2 R" U& N) E5 N* C
output="XXXX"
) l  ~4 K. d1 I3 [* C. }* Y8 vSet debugstr = New debuggingConsole
2 [0 Z: a  r- x2 K- A: W; Bdebugstr.Enabled = true
: g% O/ G; a! X" J* z1 |+ g; t   debugstr.Print "参数output的值", output
2 V* s5 q* ~& ~% B4 l. i& }+ F   '…… 6 y  \0 s$ B. P) h
   debugstr.draw
# I! f& V5 [1 Q5 zSet debugstr = Nothing , E/ k( }6 }# `. y$ z9 V# o
%&gt; </P>
$ ?) `2 A9 F( X  [$ z<>=================================================== </P>: j4 _9 T% A- j# M3 S# j8 U
<>debuggingConsole.asp </P>
* O3 ^6 s( W8 t( @8 {6 s<>&lt;%
; t# }; I& ?: m. e2 s/ l8 _) Q1 w  F6 \6 kClass debuggingConsole </P>
1 {7 m- \  O9 K; e  S3 N( }<>   private dbg_Enabled
# W/ G4 {% r2 ]4 G7 m   private dbg_Show 8 g: p$ x: N& F0 w3 U: u" m
   private dbg_RequestTime
0 u! _0 i" @! a+ Z/ S5 @   private dbg_FinishTime
0 m* R2 \; k; U- |   private dbg_Data - a1 Z% l. _( F) M. Q: ^0 W
   private dbg_DB_Data 2 r% I& ]( u+ q1 ~  L: i! m
   private dbg_AllVars ' N5 z0 \" K$ G3 U% N
   private dbg_Show_default
, ^- F4 l7 x# Z7 X- C! u2 e( Z$ I; f   private DivSets(2) ! m1 o6 E" u( l8 D+ |1 V
   
8 Z! [, V" q) M- w9 h9 L+ }" N'Construktor =&gt; set the default values
2 T' Y* |: W8 c# CPrivate Sub Class_Initialize() * E3 Z- h& \3 z3 S4 q. {
   dbg_RequestTime = Now()
* H* \6 k/ V. ]8 ?$ |. I2 k1 E   dbg_AllVars = false
" E$ V* \" v9 n: b   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
/ R6 ?1 X2 d+ s<>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 {( Y0 f: C% V5 j9 b( `7 Y! G0 a: W
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
# E) N. ~" l! x3 }' e4 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>
  P; t* D/ k, t$ ?<>   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>
+ p3 W- c/ ^& ]<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
2 N1 w% \9 d: z$ a, m+ FEnd Sub </P>
5 b9 O! P6 D2 G2 p  f% c% p<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 0 K. ^; O  @6 g+ C; Y' \: v& p
   dbg_Enabled = bNewValue ( K5 z$ z" y$ x) a! M
End Property </P>
: R2 p# i# u! R, @  E/ H5 J<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
# {+ G& I. N$ @2 B9 C   Enabled = dbg_Enabled & X+ T% e$ d6 s$ F( [$ U
End Property </P>. U; L1 F3 B4 a% g/ L9 o
<>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 - I6 m2 y, S, f( v
   dbg_Show = bNewValue
5 W" H" O  T7 v4 X5 ~End Property </P>% C8 R6 t, g% x8 ?! _2 B' P4 G
<>ublic Property Get Show ''[string] Gets the debugging panel.
# m& F: G+ Y( I0 v   Show = dbg_Show
: n& L0 [" R7 j4 m. xEnd Property </P>4 S! X$ n5 }" I' X9 n/ u
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 3 z" l/ |2 a* L2 I2 [0 c5 j$ e/ J
   dbg_AllVars = bNewValue
: c! U# w6 J: ]5 M( y! P3 `End Property </P>; o! x& R) ~  Q7 ?
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. - u$ N3 X  u7 F& [0 k2 f( K/ m
   AllVars = dbg_AllVars , ~- w9 `9 ^! l7 z: L
End Property </P>0 C$ |' R/ F: {; k7 ^; `: T
<>'*********************************************************** $ `5 F: I1 T/ _* L) ^( V
''@SDESCRIPTION: Adds a variable to the debug-informations.
7 |% t" Q8 \. l' l: S. R, k''@PARAM:  - label [string]: Description of the variable - Q- m. b% }/ B: u+ b: ?( a5 F
''@PARAM:  - output [variable]: The variable itself ; r: Z* J+ I0 M4 o2 u* L2 v
'*********************************************************** ; t0 K' ^5 L( P2 N
Public Sub Print(label, output) : W9 g2 q% F3 o* _, [/ X
   If dbg_Enabled Then
4 h5 A$ B3 ?3 D3 d/ \& I" r% b     if err.number &gt; 0 then
6 q6 o: W, g: e- G9 s6 ?       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
* v% r- `4 D; x# l# T+ ^8 Q4 _       err.Clear
& A0 O+ U" L% y6 a- N3 p+ `3 i1 ^     else
6 A6 W  j" X1 P       uniqueID = ValidLabel(label)
! J5 `% u2 {& A       response.write uniqueID * N5 w& m* b9 G: H: q5 @; n5 d* E0 j
       call dbg_Data.Add(uniqueID, output)
0 w* @* {- J% l# S& @     end if
5 b; H: i* l* p0 `$ \: T# M& z   End If
' R9 u7 Z: {6 v5 tEnd Sub ( _. y) l+ y+ Y5 D, j
  9 ?, x& j9 W! I, J, V
'***********************************************************
- M1 O% G) N* N$ U- J'* ValidLabel
% j: ^9 q* }: i3 f+ A- W'*********************************************************** , W& L+ e' Z) C% |) N% U& T
Private Function ValidLabel(byval label) 9 s/ L! g: t3 k8 S
   dim i, lbl 8 |9 @: f8 [1 P. X$ \* r
   i = 0
# _4 i! s' @" ^! w7 [   lbl = label
  G5 x3 V# ~/ H. t' c   do
, {( S8 j# T4 \" z9 N   if not dbg_Data.Exists(lbl) then exit do
& o6 z/ n5 V7 j$ p/ ~   i = i + 1 5 v" C' R, Y4 S# P- a
   lbl = label &amp; "(" &amp; i &amp; ")" 4 N- H+ K: K% C- e
   loop until i = i
: T' x8 c" p* S  
5 K5 s# O% [: I: Z   ValidLabel = lbl
" G; x1 k  {8 b3 P4 tEnd Function
6 Y6 I* D5 B; T8 u( `" o) `4 Q  
/ u" t( Q* {. T3 R'*********************************************************** ( ?1 }  m& r6 h- P, U
'* PrintCookiesInfo $ x7 h1 g; q" U0 `# [( K
'***********************************************************
" L9 b' b) \/ ?' n; JPrivate Sub PrintCookiesInfo(byval DivSetNo)
) N- U1 y! E# j" U7 X# t! Z9 p   dim tbl, cookie, key, tmp ) F! Z% U4 U; |# m6 U2 B: S# ^
   For Each cookie in Request.Cookies
! e/ H( w0 v- }7 L8 u   If Not Request.Cookies(cookie).HasKeys Then ) n  _& T8 ^7 w
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   / i( W6 t5 x" |, v, G4 _+ X8 J  K
   Else
7 [* m! Z8 Q! d' B, T. U2 `7 L     For Each key in Request.Cookies(cookie) 5 p4 k  `; |% j6 G* s
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 0 H7 o# u1 C3 z4 Y, N
Cookies(cookie)(key))   # f" {" R$ _  Z6 D: s
   Next ; |5 l9 U/ N% A3 f4 X' b" d
   End If - q! f( j- t  t3 {1 |5 y4 L
   Next </P>
7 B! D$ Q6 W+ @1 B2 L! B  t, E<>   tbl = MakeTable(tbl) 4 ^4 H. z( H1 K' P
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
, g2 `7 I; q( g/ N( K0 _6 I& S5 A% g   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 2 s( k1 |% ?7 H* R. o5 {
   Response.Write replace(tmp,"|", vbcrlf) . k- |& G2 k1 [# q; P
end sub 1 j) O6 }% C" F* u5 I; G. d% S( {
  
" i' q) v/ D- ?4 r! F'***********************************************************
% W: o9 L1 r. c) {7 c'* PrintSummaryInfo - U/ }! w  C: Z; y/ j! K, O+ i
'***********************************************************
$ m7 r! G9 D% ]' Q; b5 E! F8 yPrivate Sub PrintSummaryInfo(byval DivSetNo)
$ @6 N5 m* Z1 s7 ?$ H   dim tmp, tbl + T* C8 a" z( z! p
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 1 j) c; G! [2 K0 I
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
) e! f; V% \: ~3 Q0 ]$ z2 Z   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
* E5 O% E# T! c   tbl = AddRow(tbl, "Status Code",Response.Status) / T9 c; j9 Q" P' K( I- F3 s
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
6 t! p8 O' }1 D1 R( V( r9 }   tbl = MakeTable(tbl)
7 |5 ^0 j% C7 @: `# q! v4 c6 O/ q   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) . i/ R- g) I/ r/ ^
   Response.Write replace(tmp,"|", vbcrlf) % T4 z: J8 ], r, i, {
End Sub </P># P; A& A/ t# s
<>'*********************************************************** " m) H* S) K( v3 V
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ' w$ P" }0 W9 X; @# F6 m
''@PARAM:  - oSQLDB [object]: connection-object
$ c. r; R0 P1 K* H5 ~- Y'***********************************************************
" o) r2 I2 O) P* N9 ?$ I5 k% r( j: l  vPublic Sub GrabDatabaseInfo(byval oSQLDB)
% d; h6 M6 @9 s4 M: d5 L   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) & k0 f4 K) F8 u. n: I! U1 g( T. [
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
" t; m9 Y' N0 q+ e, G   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"))
% a6 L* M) ~" d; X  Z; r   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 6 X8 p; n4 P: q4 Z! [
End Sub <>'*********************************************************** + r3 T2 d$ n7 y" d1 r4 j
'* PrintDatabaseInfo
' _' @3 M, r% l, {/ F'*********************************************************** 6 }; \7 v. F8 r$ }
Private Sub PrintDatabaseInfo(byval DivSetNo) , U; Z* X2 w, q5 t! i8 o
   dim tbl
% T- ^4 S& J8 L* _   tbl = MakeTable(dbg_DB_Data)
0 d' U# B7 @0 E# H! c   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
. b3 j5 d$ B3 u/ H   Response.Write replace(tbl,"|", vbcrlf) & }( }3 f) P9 q* Q/ K
End Sub </P><>'*********************************************************** ( H/ Z8 ], P0 [3 N6 M0 X. K' S5 ]( Y
'* PrintCollection
7 k$ y' o  C. M+ d$ g+ @'*********************************************************** 6 O* P( V# H: `2 Z3 z3 y) ^
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
6 L0 f* D+ B8 `: W9 A) @   Dim vItem, tbl, Temp 5 k  @2 I) v8 |/ [, A
   For Each vItem In Collection
3 m) L) p; ~/ R" h+ B- ~     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then / h, Z/ k5 Q8 N) K
       tbl = AddRow(tbl, vItem, "{object}")
4 {3 V9 A. r9 R  A0 d* b' X% {     elseif isnull(Collection(vItem)) then
! Y: A% U! K$ `! ?* p8 G1 t       tbl = AddRow(tbl, vItem, "{null}")
) o- T5 k: o8 I; v" c  ~, u/ U: q* `     elseif isarray(Collection(vItem)) then
0 b" ?$ d- B, T. I. V       tbl = AddRow(tbl, vItem, "{array}")
; u; J2 f% C6 T+ f     else
+ T  U" k9 v7 }5 c1 z2 r" Q9 x       if dbg_AllVars then
. X  Y# ~; n! X       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 3 x. ?- d, K! ^5 e
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
2 J6 l- G: `9 z       if Collection(vItem) &lt;&gt; "" then - L7 v: Q9 \  [% l. t
       tbl = AddRow(tbl, vItem, server.HTML
+ t" k0 T3 z  o  g, H% e) A4 HEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ) v8 J% j* b! s  e2 V( _# j
       else
: E4 S0 ?' u& Z0 Y# j+ D0 K       tbl = AddRow(tbl, vItem, "...")
" n+ L/ c3 w. s' \' S4 g: x/ V) y       end if 7 V3 }, Y7 o8 e: {# f% T
     end if ) J, E* J  i% o# s* X
   end if ; Z2 |8 s; l3 {. H
   Next
3 u( [: P: Y  a9 A   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 0 Y, L6 k8 ?0 V
   tbl = MakeTable(tbl) 8 o; s9 a2 i1 n
   if Collection.count &lt;= 0 then DivSetNo =2
% Y1 h5 l8 }9 i  B, x/ S9 r( b* e     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & y0 S) K9 ~& V. T# B4 h& S5 A3 K
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) % a' Q1 [! E  |2 x4 C; j. S
     Response.Write replace(tbl,"|", vbcrlf)
4 M( C1 {& W- `, jEnd Sub 2 U, j0 Z9 g7 u8 V
  + m! z2 n$ V, S2 p8 i
'*********************************************************** % j* j/ r/ e6 p
'* AddRow
) \& {* e$ W7 n7 o" c! D'*********************************************************** ) S7 n3 M- O. _& ?3 [7 Q( m( P' Z5 m
Private Function AddRow(byval t, byval var, byval val) 8 \( U9 w: V/ E, C/ q7 o
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ) c6 `8 f7 V- C' u1 ]
   AddRow = t * s- A7 v2 X3 r$ r' D
End Function </P><>'***********************************************************
! @. x# {, _  u! E'* MakeTable : r: M3 j* L3 L: \7 N
'*********************************************************** 4 B* ~2 E4 h3 l
Private Function MakeTable(byval tdata)
, f9 r" ]2 Q+ h* |" _   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" " Z4 m3 c3 Q3 ?
   MakeTable = tdata
5 y) m5 D8 Z- W2 L3 @5 G: iEnd Function </P><>'***********************************************************
4 Q2 I4 m# O7 I( L''@SDESCRIPTION: Draws the Debug-panel 3 g5 S  S5 L( y
'*********************************************************** * A, P2 D- n; }+ P, z& N" Q
Public Sub draw()
) K! U  s5 O  o& P! n6 ?' ?   If dbg_Enabled Then
+ @8 q$ E6 ^! b9 A) e     dbg_FinishTime = Now()
4 \2 d! J5 g: p+ d% W4 d2 d/ e" x  W  ! n7 d  J2 o- z7 s+ t
   Dim DivSet, x
2 X% j! x0 C$ Q/ v   DivSet = split(dbg_Show_default,",")
5 s1 i/ w4 N( N) C4 e     dbg_Show = split(dbg_Show,",")
" r4 ~) }/ R2 @2 H4 W/ B  
/ M9 _; d8 s% x% z) x8 x  Y   For x = 0 to ubound(dbg_Show) 9 X( u: b8 n. l  |
     divSet(x) = dbg_Show(x) 3 D. A% j' n1 K* w6 i- n. w/ ]
   Next ! H4 a" W* X9 o7 e8 j" d
  6 T$ k/ ^# Q; [
   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+ d# y# W/ g& l   Call PrintSummaryInfo(divSet(0)) / c1 Q0 I: w. c
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
8 h3 c; o1 i* t9 ^9 I- ~    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
# g+ r3 i' C& R. r    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
2 R0 @6 T' J0 S$ a4 ~+ m0 C6 R% F    Call PrintCookiesInfo(divSet(4)) 5 a0 X9 }5 l* M" ~$ L; 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))
/ a* X) {% _5 h# ?; ?    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 4 ?/ `& W. S7 `+ b$ |
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' F. T: T- F1 M7 k4 ?; i: v0 }% ]    Call PrintDatabaseInfo(divSet(8)) 5 O( @6 K8 o/ i2 c' O
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : N) p3 O  Q! ?) k9 b2 E
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 r- A& Q4 \* K. O2 ]4 w' b; j) X
    Response.Write "&lt;/Table&gt;"
! c2 [0 u4 O) ~0 ^+ t5 l" C) T   End If 9 }! K, P0 Q! u" k. E& ^
End Sub </P><>'Destructor
9 W: N' l9 ^7 y  {9 FPrivate Sub Class_Terminate() : W  h0 Y- \& i5 \' L
   Set dbg_Data = Nothing 4 p. Z3 W5 Y, w& r
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>5 @; I( b% F, y8 Z- S+ z
CLASS debuggingConsole
: H3 o6 C7 U7 S( l% t" D+ U3 `Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " z: Z1 ~. h3 f5 Y) b# h( f
&amp;n6 A5 n9 |1 ]1 f5 ^/ y5 f0 N: g2 t+ u
bsp; 2 b( @$ L$ d% A: D. U1 P
Property Get Enabled===[bool] Gets the "enabled" value + [4 f( ~( D+ C+ i! B. e; ^( u6 O
  - N' v& ]1 k: ]9 _
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 ' D: {6 G- C# v. L
  : G3 G9 R( c; j3 v0 b; r2 q
Property Get Show===[string] Gets the debugging panel.
/ u) Y1 X! e- A    h# @0 g; `2 P9 h) q* q8 u9 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><>-------------------------------------------------------------------------------- $ x# [+ F# o  V' Z8 i
Public Methods </P><>public sub===Print (label, output)   `; O$ j" ?0 Z, o
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) " P4 N8 c1 m7 p5 p; ?/ K! W$ l- w
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
- ~$ U+ I3 G2 p0 p: e   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
" r1 C/ ?5 n& R) [- L! ]% ?Methods Detail
# {3 J# w; j; y    e) O0 Q. ~  p3 i( z# j+ w& _
public sub===Print (label, output) 6 o0 ~, ?$ q/ z& a
Parameters:  8 m$ X/ z4 t2 ~: @6 U8 G
   - label [string]: Description of the variable 7 x7 ]4 f4 k- ], O, |
   - output [variable]: The variable itself
/ G; Q1 B; c% `0 \. [; u  , M' i# V$ S" E, X7 j' d
public sub===GrabDatabaseInfo (byval oSQLDB)
' X$ R" K2 s- T8 q. EParameters:  0 {" l4 y% F5 q. E4 m! I' W
   - 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-13 12:50 , Processed in 1.338519 second(s), 56 queries .

回顶部