QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>/ x! T$ o% [1 g' I4 @
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! , U# H. t' l6 z  k/ Q3 u
使用方法很简单:
8 s5 d9 Q8 G2 I/ C6 m( {, N- b5 Ftest.asp </P>' A+ w5 ^' \9 Z% ]2 ]. K* F+ I) a
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
  Q9 }' R' ^. ?7 K7 R&lt;% 1 ^5 d  W: x8 n% r- k
output="XXXX"
. @1 M5 Y5 o$ u: Y0 mSet debugstr = New debuggingConsole " Q: g! d$ `- z9 P/ O/ B
debugstr.Enabled = true 5 ~5 }; A# _9 v
   debugstr.Print "参数output的值", output 4 x0 T1 J8 ?" H5 ]/ {
   '…… 0 e6 o. p% c# F  [
   debugstr.draw
% Z! W' l! M( q" \( c1 E6 ~- OSet debugstr = Nothing 5 A: V6 X; L7 P- l# Q" Q+ K$ s
%&gt; </P>( U& ^8 m1 W, G  P( h
<>=================================================== </P>/ a! \' A. a2 w7 E: j
<>debuggingConsole.asp </P>4 ~- ~( g2 K& n. c1 x, r  X
<>&lt;%
- t$ @4 k4 t  RClass debuggingConsole </P>
' O1 j# ~% p/ n% |2 B<>   private dbg_Enabled " y" M" q5 n0 U
   private dbg_Show 2 c1 I) z6 b4 e' g9 \; f4 x
   private dbg_RequestTime
- `5 m' t* }  Z6 \   private dbg_FinishTime 5 `+ M/ G# F5 }
   private dbg_Data
$ W6 O" S. {7 g) M# p8 u- v   private dbg_DB_Data % J" y8 B5 v  _* A$ ^8 r
   private dbg_AllVars 6 v$ ^* t6 _1 B( c# V- c
   private dbg_Show_default * o! e) h2 u  f: c; [/ D5 S
   private DivSets(2) - ]3 ^; r9 Z& N5 D( o
   # E) D$ \& Q+ p
'Construktor =&gt; set the default values
; D7 R* N2 o' V8 C% D0 x. X& kPrivate Sub Class_Initialize() * ~4 z9 C* p2 x5 [( j! X& |. J
   dbg_RequestTime = Now()
- u; E( R* p0 _! W0 u% O   dbg_AllVars = false   c5 C* n9 c! I7 V% L( b
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>0 w/ w: ?8 ~7 D2 ~$ d0 I+ @
<>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>$ _2 O/ s$ S- M) M7 _# l# Q4 p
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;- U0 E% h4 \5 [
&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>
  W* B+ [2 e2 C7 ~8 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>
" l  X) A) M, S: L6 Q<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
; \% R/ K$ p* t" e7 KEnd Sub </P>  k4 A. c8 p! d# Y  x) E/ O2 {
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false   {& k6 C& J8 k
   dbg_Enabled = bNewValue # _$ a2 M, M6 }; J0 h" w
End Property </P>, C4 @1 r9 V  T; L
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ! N9 |" z/ `5 @; b+ W+ ~, [
   Enabled = dbg_Enabled
( O1 C- V  F* {! }8 t! ?* BEnd Property </P>
+ y- t" S6 M, }+ ~7 k/ }! w& U<>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 " g" k& y: N9 A1 T) ^# a; K7 V
   dbg_Show = bNewValue . G6 P* }7 d' z5 n/ X
End Property </P>5 c! O1 u  Z6 q7 y* j& g
<>ublic Property Get Show ''[string] Gets the debugging panel.
7 _$ _$ `/ |; i) P8 X' M   Show = dbg_Show 0 ^$ t* @" ?0 K6 T4 A
End Property </P>
' w. d9 v! x, }8 p; n$ o  F<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
9 X3 l/ @0 i! @5 w; d% [0 R   dbg_AllVars = bNewValue
* i2 w5 E0 l0 ~+ M5 E& k' cEnd Property </P>
! [# j; k" P1 R) ~( e) H& U<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
0 z1 s8 Z* d3 X   AllVars = dbg_AllVars + m4 E* _. d8 r" v. J- v
End Property </P>5 z) e) q' p' G6 Y: G8 {3 Z- t# `
<>'*********************************************************** % M/ j) }" c. u* u' ], f
''@SDESCRIPTION: Adds a variable to the debug-informations.
" G, h5 e; g% b1 L9 m''@PARAM:  - label [string]: Description of the variable
' L, N( N. x. c' i  D''@PARAM:  - output [variable]: The variable itself
' }# x9 e- N& B' d'*********************************************************** + G" }% |' o1 M0 w; Q6 T. P
Public Sub Print(label, output)
5 J/ z( b; `! r: x# O, {   If dbg_Enabled Then
& X6 ^) P- ?/ A# r$ ?# I     if err.number &gt; 0 then
- K4 J" L( m" k       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ; t3 V! a3 v1 ^5 }* L3 P
       err.Clear
$ ]7 O* n) X) m& }     else
; w# F( K0 c0 ?& q( [5 j. X       uniqueID = ValidLabel(label)
, x: x& h7 Q, H, ?/ R       response.write uniqueID ) B1 e* l: U2 W' L
       call dbg_Data.Add(uniqueID, output) 2 A7 f- r9 r% D! E9 h
     end if
$ U; N  h3 O* h% J% U+ r  n   End If
9 \! M/ Q) k2 bEnd Sub
' _# y! s% J6 q! g& r6 j& E. U  
# E, k) i; `6 p; r$ y; p& ]'*********************************************************** 2 L* d& a; l* Q) ?5 S) D. k
'* ValidLabel
0 e! E6 b2 V: x6 ^+ k' W'***********************************************************
8 a  a- L- g3 ^6 V# t% r2 @2 @9 \Private Function ValidLabel(byval label)
4 `$ |& h# m% U. `( d   dim i, lbl / _6 f/ I& B: ~+ M. f
   i = 0 ! Q0 l0 s8 J9 J4 K% K9 Y- \
   lbl = label
4 K" e. R# E/ e7 L6 s9 }1 ^. D5 [   do ; p* l* I4 ~/ e
   if not dbg_Data.Exists(lbl) then exit do ; i" V! k& h) S9 H1 N" P
   i = i + 1 / y. Z6 s% ^; |. S$ N0 i! ~
   lbl = label &amp; "(" &amp; i &amp; ")"
  Y* D' O% c- u$ v2 F7 D   loop until i = i % H5 w6 S4 f* ]& [  W+ C! d
  4 c, f# d  u0 z# B6 D9 Z- w
   ValidLabel = lbl
; |) E3 V% U( f5 z5 N8 ^& S% KEnd Function   B( A) F/ R. K) |
  
1 F9 `2 J+ a9 Q) m3 u* L9 f) F* }'*********************************************************** 8 j8 K( Z0 [8 y7 E
'* PrintCookiesInfo # m- w( _3 O# I' ^5 s- a/ V
'*********************************************************** 1 e' N5 Z. y/ S
Private Sub PrintCookiesInfo(byval DivSetNo)   @5 T; F1 I) j) M4 p2 @# P, u% B  L4 R
   dim tbl, cookie, key, tmp
- c4 g* {; W; A2 E! V  w, d  \   For Each cookie in Request.Cookies * ?/ x% _" P% n( W0 o
   If Not Request.Cookies(cookie).HasKeys Then 9 _" g3 R. M" _0 f" e/ Y; W
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
6 [, j- A1 V" W  M   Else
5 H2 ]1 A1 X- M0 O7 f3 j* d. }     For Each key in Request.Cookies(cookie) , L9 N; A+ `! D7 q+ B
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 4 j! \8 p) w' E4 w, o
Cookies(cookie)(key))   ( `, z- i' |" i) Q3 [1 ?5 R# ~
   Next
* q4 J! {/ J5 q% Z% U2 w, X3 v   End If
0 ]7 d5 Y2 W' L: D  j" {   Next </P>7 T( \) o4 N# h% c% F* {
<>   tbl = MakeTable(tbl) ! Q& n& [7 J0 Y' g. h
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
: o1 |. r1 b: ~; h   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
7 `# T  f/ L/ `  N, F* W   Response.Write replace(tmp,"|", vbcrlf)
. `: G! E( ^% @end sub , N! D1 p* }4 U7 @5 q- o1 p
  / D" v. G. m! B1 C8 \5 c
'*********************************************************** - Z# r: m2 c* \: z  f8 n' @' @
'* PrintSummaryInfo 5 y9 U9 S3 f' j
'***********************************************************
6 T# Q2 ~. u0 t, K3 P4 |2 gPrivate Sub PrintSummaryInfo(byval DivSetNo) 2 W! g+ @0 t- y" i
   dim tmp, tbl 0 ^9 H% [8 R$ G# B! [  K
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) / U# f- U9 \* A8 b
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
: Z) k" w2 h% w0 H9 G/ ~   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) / S4 f7 a5 G2 A) J
   tbl = AddRow(tbl, "Status Code",Response.Status) ) M, C, _6 h* l( F" q1 N
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
1 g- A) S7 K3 a1 M# M7 l   tbl = MakeTable(tbl) 1 g9 R3 @3 P' g( d" X! }% a
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 0 w0 r' e% w6 a0 W; O
   Response.Write replace(tmp,"|", vbcrlf) 3 G- F1 G4 a' U
End Sub </P>
* E, X/ o8 h% P. p( ^* ]7 M* T$ t% b<>'*********************************************************** # }& J/ k1 p' F& d9 D) m
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 6 q4 j' G7 ], o$ g" z* Q  J& t' m
''@PARAM:  - oSQLDB [object]: connection-object
) O. e2 ?; K" U0 d) h  U'*********************************************************** 5 j* j3 E' c! M8 u
Public Sub GrabDatabaseInfo(byval oSQLDB) 6 F) o% C6 u1 z& P
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
/ Z& T8 C/ e- ]   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) , q9 w7 Z. W6 n/ W3 W
   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"))
' r7 X; r( [# ^# I3 D   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
5 V2 f# f6 t% I$ u6 fEnd Sub <>'*********************************************************** $ e2 \2 l+ U" C
'* PrintDatabaseInfo
" r  H- w2 |5 p: I: U'***********************************************************
8 n6 e0 E- b( Z7 m. t- @Private Sub PrintDatabaseInfo(byval DivSetNo)
+ ?# A  @4 M* y( R! u   dim tbl 0 r4 [: k) K+ C9 _" Y8 j
   tbl = MakeTable(dbg_DB_Data)
/ o  Z4 U: \3 Z. @: U* }- |+ V   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
; L3 o6 Y: G' k/ j   Response.Write replace(tbl,"|", vbcrlf) 0 ?( L, x* c  ]) q' y- J- H
End Sub </P><>'***********************************************************
6 ?/ t3 k5 l/ S! M: ^; t$ I'* PrintCollection
( X! s- P2 c8 Y2 C8 u. K'***********************************************************
% t" e9 m, A! g: {1 }Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' ]2 ^* g2 I& o, {
   Dim vItem, tbl, Temp
, }! x1 S5 y3 [- w" z% R& S* H   For Each vItem In Collection
. h1 B2 ~) P, c9 T     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then % h3 ^' n) ?6 w! s& x+ f
       tbl = AddRow(tbl, vItem, "{object}") 5 h" h$ ]' s7 _, e! N
     elseif isnull(Collection(vItem)) then " X4 V5 [8 J  X
       tbl = AddRow(tbl, vItem, "{null}") ! d8 `! N) s$ G7 C7 B
     elseif isarray(Collection(vItem)) then
! r0 [1 z9 k# m% p9 X! a       tbl = AddRow(tbl, vItem, "{array}") ; v7 o& R: [! h8 _  o' C' l9 |! D/ i
     else
6 l9 D, v1 ^' c' [       if dbg_AllVars then
5 L5 b& K" h8 `! I       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 2 @3 ~, I, f3 ^9 s3 |3 g
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then , f/ k/ [. T1 t! h
       if Collection(vItem) &lt;&gt; "" then
; p, W  h+ v! {9 C9 U5 B/ [       tbl = AddRow(tbl, vItem, server.HTML
( d. U( H9 t' }+ `3 B  J* XEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ( d  c$ H/ [3 X2 L
       else
9 }  _: P) {, P0 Y" s$ {) R       tbl = AddRow(tbl, vItem, "...")
& N+ O# E% C& m3 ]9 W2 S( M6 x       end if
! H5 e8 z0 B4 a( y+ r2 f) ^     end if 5 u, s4 Y& ?$ V; L) G' W- o: p' ]' e; Z
   end if . |1 Q( Q" ~7 v* I$ s8 o
   Next
) h8 o7 }5 M3 j# c   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo * S0 R, z' y$ S0 k. F+ ~* [
   tbl = MakeTable(tbl)
% P0 D0 L5 G; P& T3 ?   if Collection.count &lt;= 0 then DivSetNo =2 . I! p; Q6 V( q6 j8 ?5 g
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
% t- u% t3 e, `  E' ~     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' u: m7 m+ _( o% _8 d$ Q$ z
     Response.Write replace(tbl,"|", vbcrlf) ) c7 g9 J9 W$ k& x8 i6 C
End Sub
: ~9 Y3 e2 q6 h  t  
# R0 e7 z  O; g'*********************************************************** % }* L: }3 w4 b+ R1 E) Z
'* AddRow
7 P" ~* U7 y) ^/ k' m+ z'***********************************************************
1 X4 G5 n( L7 OPrivate Function AddRow(byval t, byval var, byval val)
6 P& b' W1 y, z8 f! J% l   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" , W( K; K$ [8 v0 J; }6 T$ v2 P0 m9 {
   AddRow = t ! ?) X  d/ O6 a! J# D4 J
End Function </P><>'***********************************************************
" K$ O5 a& c+ J/ N, G7 B'* MakeTable ) b9 G9 ?4 C5 n% s: w# Q
'***********************************************************
  o- l$ E+ g7 O+ F+ g! JPrivate Function MakeTable(byval tdata)
' ^  U% }3 U  {2 [- E   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" & M# Y0 j0 p. x; l) s/ ]
   MakeTable = tdata
2 ]" l& N- L( U' k6 i( tEnd Function </P><>'***********************************************************
! q+ t( z9 b4 F' u2 g/ ]''@SDESCRIPTION: Draws the Debug-panel
: t0 m6 P2 V: c* H  J( e8 M'***********************************************************
+ L% e) G: `4 wPublic Sub draw()
5 W; @+ Z3 {/ a# k4 U   If dbg_Enabled Then 8 G, r1 S7 b' |  g; k
     dbg_FinishTime = Now()
5 a# X+ ]2 N0 E0 j0 F  ( P, y& c9 M2 d& t& ~
   Dim DivSet, x % M& Q) {& M' g
   DivSet = split(dbg_Show_default,",")
7 T, [4 y8 [7 u     dbg_Show = split(dbg_Show,",") 7 a9 K. ~0 P3 x% j6 h
  % ]# U) X- A3 v" j
   For x = 0 to ubound(dbg_Show)
# [' P( y7 ^& x0 `7 L     divSet(x) = dbg_Show(x) 6 Q$ F/ ^1 a' i5 Q; k% F3 v
   Next
  S; o! u) E- I7 t  0 U, }( A5 i; Y! G/ e+ m: f
   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;"
5 W, g" a5 Q- M4 w8 D9 [   Call PrintSummaryInfo(divSet(0))
1 a; i' j: N8 @     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 p# P" d9 r( S0 S
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") : c+ h7 a- L% J$ y9 ^1 H- g
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
  o, g0 T" e# z' Q: ]    Call PrintCookiesInfo(divSet(4)) 9 e( s, M1 m3 y( I/ w8 H
    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))
) z8 F! {% e+ |1 i    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) j5 e( B6 @: I2 C+ S/ B: G6 ?
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ; w: ^$ x* _8 |
    Call PrintDatabaseInfo(divSet(8)) 8 G9 M& }4 h5 H8 `) `+ M* P) @
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 8 g2 I* z5 h, w, t
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 T9 ]! J6 P; n$ f+ `4 ]5 k    Response.Write "&lt;/Table&gt;" 0 d5 N2 v5 i; j, d$ x6 [5 f; b
   End If / N" I& ^1 k2 z# ^. q5 X
End Sub </P><>'Destructor ! u: Z- W6 @0 Q& W1 d
Private Sub Class_Terminate() 2 B' R" r0 w' }+ F
   Set dbg_Data = Nothing
3 B* s- s4 A/ J$ Q( }. }; QEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
% [( V' G( D: z! JCLASS debuggingConsole
' y0 o4 o$ g  q6 R. {$ ?, dVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false / N1 V* l4 q; R! P
&amp;n
8 g# }9 }' e3 Lbsp; % ]+ ?( X5 I& W' }( v2 P" p+ {
Property Get Enabled===[bool] Gets the "enabled" value
: A$ I7 _% x& w  ; m" Y* L  H; Y' i) H/ S; b
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 1 `- u$ u3 H8 Z0 K' }: z4 C- l
  * G  p7 f- S: c
Property Get Show===[string] Gets the debugging panel.
- x0 ]3 o' M: I; a% Q  : X3 u8 j2 a0 z, }5 }9 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><>--------------------------------------------------------------------------------
( j2 b, C3 d* U8 C( aPublic Methods </P><>public sub===Print (label, output) ' e: B* v7 d3 w6 C$ s# m
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
  @+ i3 r' |4 g* Z2 h   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
- K: k' H3 `7 f/ r   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 0 Q+ ^' e! S  ~5 B+ d1 ^# ~2 ~1 j
Methods Detail ) O6 ^# I" ]% G  y! m$ U: Y9 X3 F
  3 z! s3 U0 K. Q7 ~. _( @
public sub===Print (label, output)
: g* L4 q& B/ H7 c+ s) m- `Parameters:  
. W# x  h3 p. [$ O7 m! W   - label [string]: Description of the variable   S7 r- i8 o/ s, L" I
   - output [variable]: The variable itself
0 l$ v& c; o% i6 m& r# W1 _  9 a1 D; p+ c* k: r7 f! ~
public sub===GrabDatabaseInfo (byval oSQLDB)
$ G2 \! _; C! q2 lParameters:  
2 x& N, U$ V7 J. i: j7 \   - 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-10 03:28 , Processed in 0.595362 second(s), 57 queries .

回顶部