QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
( [8 {7 c$ W. I6 C7 A<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ' L3 i! p1 y8 `, u' X5 W' e
使用方法很简单:
) F% [, {5 T, j* T$ _2 Xtest.asp </P>5 _5 i! w8 Y8 u+ @1 ^8 ^3 w: q
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; & D* l* V# L5 V) a; i; k
&lt;%
( X+ D% |, Z- h0 A- T( t1 houtput="XXXX"   u8 ~5 n" {3 K
Set debugstr = New debuggingConsole
% x% J! f; p4 l+ ]  K2 Rdebugstr.Enabled = true
( U( u6 b% o& a   debugstr.Print "参数output的值", output & i; a" W7 }/ `. |  F0 W( x4 N' i
   '…… 6 e% Y( B* [6 r; ?
   debugstr.draw , l8 {7 t/ q  A9 P# c6 t
Set debugstr = Nothing $ k9 `7 y% E; x4 {
%&gt; </P>9 R( R' D* J1 u/ Z. T0 A* m, j  [
<>=================================================== </P>0 }" T% N4 @  P2 ~; \# B
<>debuggingConsole.asp </P>4 c/ L4 F+ f3 i. n( K$ s, @
<>&lt;% $ ^! A# a, r, t* G' s3 {
Class debuggingConsole </P>
0 m5 W) v0 A3 D6 [) f, O' W* ~/ D<>   private dbg_Enabled 3 \2 O! ?" {6 H% j8 r
   private dbg_Show
, B, b* T+ C7 O( C* \   private dbg_RequestTime
. o5 E3 c4 ~8 n* m" D5 C6 o   private dbg_FinishTime
4 p, Q2 J2 _8 @9 A2 |6 e' V0 n1 n   private dbg_Data ) {2 P, ]4 _7 e2 }- |! D
   private dbg_DB_Data 4 H# D" {9 O$ P! \6 E, P& o$ s
   private dbg_AllVars
% H# t+ u6 x6 d( v   private dbg_Show_default 7 d- R6 F" j7 k
   private DivSets(2)
* P: b1 f/ J8 w/ R  l   " G$ q' b& L  c) }8 O' |
'Construktor =&gt; set the default values $ o) a, f, n1 x9 q
Private Sub Class_Initialize() ( {9 u5 v$ j; m  ~
   dbg_RequestTime = Now() 0 F' r* J/ `) ^- y2 F
   dbg_AllVars = false 4 A1 N7 u) _* a4 i
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>- L- Q7 S0 p( E+ A. W. o6 q
<>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>
  W: Y2 O2 i* b, D& s; ?8 ]" M<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
, j! O; Y7 x; X1 g&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>
5 E! p; i1 ~3 R2 ?) H<>   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>
' D) G# m" l+ w  J<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
6 d' i# K  Y/ Y0 ^+ H5 u: wEnd Sub </P>
1 d0 `6 K% s) r5 b<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false # v7 X; b/ o; R
   dbg_Enabled = bNewValue
+ M; n% i7 h5 L9 J0 Y* A8 qEnd Property </P>5 ^' ^, U8 l0 Y" \3 D" Z8 `) d
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
- u' G! {- t3 k7 l$ E' T. Z   Enabled = dbg_Enabled
, ^; l3 I# x  v& T, E) hEnd Property </P>2 t" [. ]. X6 v7 a: \3 {
<>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 % C( w+ F; l) A1 f# H5 Q* I% t6 W
   dbg_Show = bNewValue & l9 l5 M6 P& L- r/ D
End Property </P>4 @& A5 D1 }0 E' B( G! F
<>ublic Property Get Show ''[string] Gets the debugging panel.
$ y( g" b# w6 ]( J7 d9 q5 ]# P   Show = dbg_Show
) S0 t/ X. n: k6 e! z% K, kEnd Property </P>  m2 k0 G, _# B. d7 F* P
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
$ {3 H& X" R  X2 ?4 ]- K   dbg_AllVars = bNewValue
9 L8 r$ v1 @. SEnd Property </P>
8 o1 u% N: u2 F" d1 X9 ^' R<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. " z& z" T8 \& R7 ?3 T
   AllVars = dbg_AllVars " D, E( t3 S& j/ u' O6 H: d
End Property </P>
+ m9 d0 W( |! Q: {. R3 X<>'*********************************************************** " O3 W& h3 e# y  x/ \" H: Y8 c
''@SDESCRIPTION: Adds a variable to the debug-informations.   l8 J$ S) Z  I- T2 F+ Q* v
''@PARAM:  - label [string]: Description of the variable
8 T  P! Q$ b$ s' Y. A''@PARAM:  - output [variable]: The variable itself 4 ?7 u# h, m: s5 L+ e
'***********************************************************
/ i1 T' I( d" x" VPublic Sub Print(label, output) % [  T) ^) _& A+ b$ W4 U2 s$ A
   If dbg_Enabled Then
- I$ e" p' F: H/ s, v     if err.number &gt; 0 then . B9 S: s8 H9 D' l( q
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
1 B8 i" g/ H( a       err.Clear
- B  P8 L" {0 G/ }0 c5 Q     else % p* F3 q& e9 ^% C2 k; ~/ s" f& `
       uniqueID = ValidLabel(label) ; ^. b) U( [* C- f0 J& k
       response.write uniqueID ; H5 u+ S2 M( |7 O9 z
       call dbg_Data.Add(uniqueID, output) * n& }5 @" R5 [* ?9 \1 \/ _( k2 ?
     end if ) I  O; Y( d( m% D4 p- g' P
   End If
% V& l  r0 x) |End Sub
2 v6 y$ Y# \' [4 e6 w  Q  
" b' c$ J! h4 i/ P1 f& m'***********************************************************
9 d& b0 ^( T7 D( i! P'* ValidLabel
" i: ~8 _# V; b. F& g+ f! C9 n'*********************************************************** " N1 P- L7 Z6 S/ P* r  W
Private Function ValidLabel(byval label)
# |3 [/ s0 \0 `2 t   dim i, lbl 1 |& H$ J8 A, i1 w4 Z
   i = 0
" [& K, l4 N# A% o  J8 Q" `   lbl = label : t0 F9 [5 z' F" ~. @7 q3 W4 w  c
   do ) h, n& R) L/ L' X7 B, m
   if not dbg_Data.Exists(lbl) then exit do ! e2 i/ q, s+ R* {* D
   i = i + 1
# ^) a: e: x* Y! W/ [   lbl = label &amp; "(" &amp; i &amp; ")"
% J  ~  @4 z9 ~* ?6 i3 x   loop until i = i
& f! Y+ h0 K# w# y  
2 I3 H7 l# R4 x# [" U# p+ _   ValidLabel = lbl 7 P. t* f  L: h& z; y* w4 x- A0 s: k
End Function
, v( Z+ `: D* K' s  
& h+ I$ Y; J2 ^; g" v'*********************************************************** & x3 J$ [3 e; \
'* PrintCookiesInfo ( h% D' {% Y; G9 ?) x
'***********************************************************
. k# Z! ^" _. `1 t* }+ XPrivate Sub PrintCookiesInfo(byval DivSetNo) / v2 @  ]1 U6 G5 r
   dim tbl, cookie, key, tmp
3 }3 ]/ l0 X! ^* m+ a+ Q3 I( z   For Each cookie in Request.Cookies
, r) \! x% g$ ^   If Not Request.Cookies(cookie).HasKeys Then ; @1 x: S2 d& `- f( v, F! A+ \
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ @3 q! o% `7 E" c6 S: [2 l   Else
2 z& C6 X0 k/ b     For Each key in Request.Cookies(cookie)
  K* a8 ~: t" G3 K: A* W/ j     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
1 F+ S- k, b6 Q/ S5 }1 gCookies(cookie)(key))   & C8 s& a$ G* G# q$ v+ w' x
   Next
( I$ Z2 P7 ]* f. N# u5 K2 S' c   End If
: v* b, S' O9 K* O. v" O8 n   Next </P>
* `: k3 l( `8 V1 T0 P. S8 X<>   tbl = MakeTable(tbl) , T( G& B. ~8 h7 I& ]& v
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
" i# W( n/ E0 u- {" c   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 1 k& \! G6 X5 |9 b( K0 k
   Response.Write replace(tmp,"|", vbcrlf) % y* w" Z; h% r, D
end sub ( S+ {9 u* [  y
  $ }9 r6 }+ I: u  e2 A  U. k
'***********************************************************
2 a/ h1 @* C* |9 n/ O/ S& g: t4 O'* PrintSummaryInfo 5 U8 u# W( [- j9 e/ T
'*********************************************************** . \/ ]" H9 Y% ^/ I  u6 F1 S! n
Private Sub PrintSummaryInfo(byval DivSetNo)
/ g, M& E9 u6 O3 K   dim tmp, tbl
# W. C2 h& }2 a+ x   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 1 L$ [* `* E; G$ m
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ) {% N& L$ D8 P5 w
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
2 @, M1 k! C! A' b( {   tbl = AddRow(tbl, "Status Code",Response.Status) 0 A; X: f7 j1 w8 @$ {; Y
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) , \9 f7 A8 a* {3 u3 R6 p/ H2 ^
   tbl = MakeTable(tbl) , s; w% V$ b+ @
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 7 j; |2 X+ c, s
   Response.Write replace(tmp,"|", vbcrlf) % T& i6 f* ~: L) P
End Sub </P>
6 O8 Z# h; z  t# g3 c8 G' ^2 E! X2 V; J<>'*********************************************************** . L+ k1 c8 u, D; _7 S% T, |# q+ s
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ! M7 t9 j6 y- Y" x! V
''@PARAM:  - oSQLDB [object]: connection-object
1 g, R& \  H, C; p0 i( R% P'*********************************************************** 9 F1 i% k$ f: T2 ^4 M
Public Sub GrabDatabaseInfo(byval oSQLDB) 5 S" [) Q( ]% B5 R4 N
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
+ L& @1 p: O& z. D   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
2 D( Y: ~% M3 I: C- {   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")) * W1 X7 ?7 E% E* N4 F3 q9 L
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) - j  `& h+ M& Q3 Q1 p
End Sub <>'***********************************************************
# K5 Q1 W$ |6 [; T# v'* PrintDatabaseInfo 2 m8 }, s* v) }. o" U6 z% h' @
'***********************************************************
4 n6 F% u) \" E0 CPrivate Sub PrintDatabaseInfo(byval DivSetNo) & T( }% }, h; T( ]
   dim tbl ) _0 J4 s& _3 r- ]& R- A2 K
   tbl = MakeTable(dbg_DB_Data) 5 w" @5 H6 u7 \
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) . U/ c9 {2 }6 G- i0 J) [% u
   Response.Write replace(tbl,"|", vbcrlf)
* ?2 k4 x9 w! j' f) @9 rEnd Sub </P><>'*********************************************************** 6 `/ Z& W, q. \; [% q
'* PrintCollection . U9 j# P* B+ O) D- N: c0 L
'*********************************************************** + a! F6 |" g7 W
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# T* o6 s& P  c4 T   Dim vItem, tbl, Temp
+ L) s( g3 O. k8 G$ t   For Each vItem In Collection
2 X3 u+ ~9 @9 I  h( Y; u0 J     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
" _$ O; C* Z' ]) |       tbl = AddRow(tbl, vItem, "{object}")
6 ]7 j7 j: t$ X     elseif isnull(Collection(vItem)) then
8 |- O3 x( j" s! s2 R       tbl = AddRow(tbl, vItem, "{null}") % _7 |3 @  `! f
     elseif isarray(Collection(vItem)) then
! ^+ L( v# v; M5 k# Z5 w       tbl = AddRow(tbl, vItem, "{array}") * z, d8 N/ s7 h( q' Z
     else " @# i, S! S+ I
       if dbg_AllVars then
; B% T# F/ j; e* v' A8 N       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
. j5 y8 q1 l8 h" e* D$ u' G2 k     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 0 V1 D0 n) f+ P$ q
       if Collection(vItem) &lt;&gt; "" then 8 ]% y2 q7 q, X" D  n% n! ]3 `
       tbl = AddRow(tbl, vItem, server.HTML
) V9 {! s, C* F  M1 [Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
5 K; r( q0 y+ y( R( l6 G7 x: x) B       else + _' g; E# @, N
       tbl = AddRow(tbl, vItem, "...") " N7 H  J3 j: I; U! r4 e: A7 \
       end if
; k$ `9 c# a) d; v     end if , w8 w$ `( i. f2 l/ a
   end if & f& M0 w5 e3 s" f4 \& |
   Next 5 W' b; f" G9 d4 W
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo . L' J, W, q: ~& v9 G
   tbl = MakeTable(tbl) 6 K8 m4 D9 A) j8 {
   if Collection.count &lt;= 0 then DivSetNo =2
$ b3 d' j% G* ?! G5 Y* X3 u     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
3 j# e3 j9 U$ f: ^% ~0 F+ X- X+ Q     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' a0 A# X4 n! v; J, u/ ?
     Response.Write replace(tbl,"|", vbcrlf)
; ?' p$ i6 y9 g5 ~! |9 EEnd Sub & X2 _8 C+ [& E" H% {9 V: K+ a; V
  
" K! g1 a2 z; d& k: k( H  v; f'***********************************************************
3 ~9 ^* V' U3 U' n. I'* AddRow ) d# A# a6 @+ x# a! h+ b
'***********************************************************
5 Y2 }3 m, a# |" D+ H* S+ d; E. ?Private Function AddRow(byval t, byval var, byval val) 9 o" \% t, ~1 {7 M% t$ E: a* V8 S& J2 Z
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
; q8 e5 B$ g' y4 m   AddRow = t
6 Q0 ~; h7 B* t' f$ Z# o, X2 f- qEnd Function </P><>'*********************************************************** ; u( X: Q; O! J
'* MakeTable ) r7 l/ B: a2 E: {. u- ^+ p
'*********************************************************** ) M: M$ \" z( r% P8 Z
Private Function MakeTable(byval tdata)
* g7 c/ c2 _7 f   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" , K; m$ E9 v  q; h: l, w- K9 p2 ?
   MakeTable = tdata
3 j+ d( d# Z/ KEnd Function </P><>'***********************************************************
3 c5 L2 i+ V4 j+ d2 _''@SDESCRIPTION: Draws the Debug-panel
2 q( `" E/ W4 S, o( E'*********************************************************** 9 ]& j/ i* d3 b$ G' b: x
Public Sub draw() 0 f. l) f% Y1 e0 I
   If dbg_Enabled Then 3 i/ @9 M* F! b) l5 z8 L
     dbg_FinishTime = Now() 2 o1 H" }8 p/ d7 c" R! k
    a0 h3 d; K. D% l
   Dim DivSet, x
1 R/ d* m- Y( G. M   DivSet = split(dbg_Show_default,",")
  I' v. q; H) v- p+ u# Q     dbg_Show = split(dbg_Show,",") 9 C- ?0 A' K+ h
  
9 `* i* z- q- v3 J2 r' ?' A   For x = 0 to ubound(dbg_Show)
* j' v* f6 k2 G9 v2 [     divSet(x) = dbg_Show(x)
# C2 j, v" l1 V, h1 G* I9 Q$ |   Next : i( c' ~: B4 ~& x4 t
  ) w$ p' Z/ [) o* E
   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;"
; c+ E* |: e( }: P   Call PrintSummaryInfo(divSet(0)) 9 B5 m8 U6 g1 x9 w5 G7 ?3 t
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ! \* ?% U, Q- L& u# b
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ m9 e2 b1 h! C. \! ?    Call PrintCollection("FORM", Request.Form(),divSet(3),"") % q) C- j# q- ^- V$ N& h/ d+ b
    Call PrintCookiesInfo(divSet(4)) % `% @4 q: T0 _& K
    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))
, L3 c6 M4 F4 e) O    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: B- w8 J8 j1 |! i  E# V2 ^    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + R) q; n# X, K2 i# z$ V8 Y1 s
    Call PrintDatabaseInfo(divSet(8))
6 ], }# [5 N% m9 ^2 N# _. m    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
. G8 @9 F# z6 K( v8 w3 j    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 6 F5 f3 }7 D' X! x8 R
    Response.Write "&lt;/Table&gt;"
4 J% D/ f8 Y# \/ T$ m   End If
6 r" z/ _$ y1 }3 @4 `. v% nEnd Sub </P><>'Destructor % R' U9 n. w, G: L' Y- c, T; M
Private Sub Class_Terminate()
! v3 j& s6 @, u! d9 q& u8 ^   Set dbg_Data = Nothing : J, W0 w* P! @( n& l5 ]7 K+ {
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>1 T- F/ `0 q% o  Z, K" N
CLASS debuggingConsole / {; N) I0 q6 a' J! v; p9 K
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false   X) I% h. O% H, g3 I/ W
&amp;n* k* l5 ^2 y# u' l7 X! P
bsp; ! a( `% O1 N+ a0 l
Property Get Enabled===[bool] Gets the "enabled" value 1 s: p$ @, W3 _
  
9 i; j5 ]' |& G8 ~, a7 W$ fProperty 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- [; J4 c1 ?2 G" }, ~  - C) U5 V/ ?  R* y7 [
Property Get Show===[string] Gets the debugging panel. $ p* h8 a1 k/ ?/ u
  # @5 T8 ~+ m3 A# y4 j2 C0 ?; }; c
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><>-------------------------------------------------------------------------------- 8 C. Z* [7 {9 _5 L
Public Methods </P><>public sub===Print (label, output)
! x  c7 q* l$ L5 m  o2 y6 G   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) : N& ]$ T9 W9 K. p8 g
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
9 Y% s. J% \& b   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
7 V  o0 x4 f& rMethods Detail ; i8 v1 X; B' H0 |# s' L
  
; `1 }# Q4 Q7 C/ O" o/ l+ K9 N. zpublic sub===Print (label, output)
1 d' \4 \2 n; V/ r+ QParameters:  9 O4 f: F) Q3 [/ v. n
   - label [string]: Description of the variable 5 ^) h5 P% S! w3 [
   - output [variable]: The variable itself - k4 A0 c9 P, u" H1 ^$ W; m
  ; `' k. [  r+ W# o5 m- b0 L
public sub===GrabDatabaseInfo (byval oSQLDB)
# O6 `( m6 F, N& }Parameters:  
3 W) L) C5 T6 Z; R   - 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-4-14 21:39 , Processed in 0.448530 second(s), 57 queries .

回顶部