QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>; d6 U- J( g8 y4 L- [: S6 m
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
6 `  y# B4 q* h1 k4 K* O3 Y6 @$ m使用方法很简单: - D9 {' [/ \3 ?- A' f
test.asp </P>. t& ?* {+ O& j
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
! O/ h( t4 }' \: h% a! f( |- y&lt;% + E- K- ~% A: K
output="XXXX"
. }6 K: g9 y* W6 Z$ tSet debugstr = New debuggingConsole
: R- w& m" S3 w. i0 J' {8 Xdebugstr.Enabled = true
! C* J/ P# s& K7 ]9 q; S   debugstr.Print "参数output的值", output
. C, s/ \" }$ g$ Z' V' b  W/ o   '…… 7 m; _  L9 I6 g4 a4 C
   debugstr.draw 5 @; `; I1 w6 @# Y6 n- K! S
Set debugstr = Nothing
( Y) l1 I* g- V/ v: @% A9 S2 H%&gt; </P>  i) v" H4 k3 A& o- r
<>=================================================== </P>7 H/ \( c6 l' [
<>debuggingConsole.asp </P>
; T: y5 @- s+ m8 n0 Y$ b" |<>&lt;% * B) E3 X, b  F( v& o7 w
Class debuggingConsole </P>
: o0 d3 H) J6 L$ C+ w/ x<>   private dbg_Enabled 0 g# `" g! L( R" {) V: R+ T$ q
   private dbg_Show ) [) E3 N2 ]% C* l6 P$ l( L3 L* C
   private dbg_RequestTime 6 L5 E' c5 }' M! \  ?/ T3 F2 k
   private dbg_FinishTime . E8 P1 }- d, z+ y9 o
   private dbg_Data
9 @8 A0 b5 u/ W' S* I5 {; G  Y   private dbg_DB_Data
/ N: ]  @0 d7 {+ ]* x7 ~   private dbg_AllVars ! D/ \& @# h: D  n
   private dbg_Show_default
+ H  h6 b% G4 Y6 a& Z   private DivSets(2)
( X7 u- g* G' a+ p   * q* N0 o. L8 H4 `) O: h/ K. \( u
'Construktor =&gt; set the default values
& G1 @5 M" G5 ]( v- zPrivate Sub Class_Initialize()
) z( c; c. I/ L5 x   dbg_RequestTime = Now() ' A8 e" `  T" w% ]. |
   dbg_AllVars = false * T& V7 l$ {( q- j8 a6 S
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
4 a" f$ K& {2 C% p1 [" R<>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>& }5 z8 a/ r, B) @
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
( S2 K6 O4 q* d' D&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>
+ V- z2 Y% F; Q8 k& Y<>   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>2 v" X( ^4 d& `; i: W) \
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
% J2 P7 N/ @4 |8 s$ l4 F7 wEnd Sub </P>
/ t5 G+ h9 ~! I<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
4 {/ L! _% r! }! a# H   dbg_Enabled = bNewValue . Y; ?. L1 h9 d
End Property </P>' I/ J# o$ S- N' O4 k; n. W
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ' ~" h8 t$ S  {$ z
   Enabled = dbg_Enabled 5 e& n* x( `& O9 A+ b: ~6 M# h7 `
End Property </P>- t( F+ Y) ~5 u9 Y1 b& T: 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 9 W& y* k$ X/ X- [0 C
   dbg_Show = bNewValue
3 A$ r: W9 R4 p6 Z) F$ j8 B  CEnd Property </P>
* A: Q6 X, j9 ]$ f, d$ r<>ublic Property Get Show ''[string] Gets the debugging panel.
$ U& l$ q4 ~. A   Show = dbg_Show
0 B  l; F* O' X0 U* QEnd Property </P>6 I. K1 r8 F, h; y, V2 f0 h
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
$ z) D( b) \% z1 A9 F4 T) ?   dbg_AllVars = bNewValue 0 k6 x, x! o7 x6 g, z( h' T8 B! G' k
End Property </P>0 i, ]* _+ K" P
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
- P, a8 o6 {3 U2 s9 u9 S/ t   AllVars = dbg_AllVars 1 R+ `$ J- J7 u9 S: d- ]2 s% p, z+ p
End Property </P>
* Y, s8 b/ u/ \& t& a) \; d<>'*********************************************************** 8 b; Y$ o$ O, T
''@SDESCRIPTION: Adds a variable to the debug-informations. 3 L. [) s9 R! ~2 y) m  I# d! h
''@PARAM:  - label [string]: Description of the variable " \- V( `6 M- |- F9 c
''@PARAM:  - output [variable]: The variable itself , D6 ~9 N' m. D0 k2 Y
'***********************************************************
2 f: j! {3 g; \; j0 I! s% pPublic Sub Print(label, output)
2 {! |  T9 G; k# K   If dbg_Enabled Then
; Z1 f  P  s# }2 E# L     if err.number &gt; 0 then 6 U1 Z6 J/ q* L, U) ~' J  ]- g  l
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)   [4 X' ~4 I4 |- r  S9 N
       err.Clear 8 H) U3 j8 ^- o% [
     else 0 e$ j9 a  s7 T/ b' T6 e
       uniqueID = ValidLabel(label)
0 X1 ~* G1 D9 O( W8 i       response.write uniqueID , V+ b5 E& G$ `6 B$ E
       call dbg_Data.Add(uniqueID, output)
4 ]/ m: Q8 X8 V9 X$ B% [- L     end if
$ ]0 Z; v5 e0 Y$ Z: g4 O   End If
& A* o* E) p8 U% }End Sub
% f& h! x% e* v0 [  
, _/ H$ d, _' J5 _: A! B'*********************************************************** 1 z1 r, z- E( a% R7 D
'* ValidLabel
! X9 p1 `2 ^5 J, {! w'***********************************************************
; U# {! v# l" N* y- oPrivate Function ValidLabel(byval label) ' J% J% B2 T9 E6 a. q. S( |
   dim i, lbl 3 X/ ~' d! f  r, }7 {
   i = 0 / L1 `) C3 z6 M. Y9 N8 t2 Y2 b
   lbl = label 6 N5 s; F6 |0 v( t  V: |! {
   do 9 {4 H& f7 O: m% s% u( |
   if not dbg_Data.Exists(lbl) then exit do
8 g9 m  N7 G: Z" W   i = i + 1 ! M2 g: ]# q  k( P0 [
   lbl = label &amp; "(" &amp; i &amp; ")"
5 w8 L$ V$ i4 E0 }9 G; f2 B   loop until i = i 0 ]- Z. m( J1 a
  
; P- x) i- `3 _2 E7 r6 D   ValidLabel = lbl
( K& s" F  s/ a/ ^% YEnd Function
$ I2 T1 J9 j; }# g: w* t  
+ T1 B) X1 k9 f2 k'*********************************************************** ) ^! q# J# {1 b
'* PrintCookiesInfo
8 x0 V$ L6 A1 V: B8 V; G'*********************************************************** . d2 [/ u; z7 O! q$ y2 X3 X- L* h. q
Private Sub PrintCookiesInfo(byval DivSetNo) - a" U* s. I$ `0 f
   dim tbl, cookie, key, tmp $ M; I; H# l. N9 m! n* N+ V" O
   For Each cookie in Request.Cookies 7 d+ F" L5 Q& n$ |3 m  S: ~
   If Not Request.Cookies(cookie).HasKeys Then 3 i3 H3 I) v. o; U# V0 U
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   , a! |6 @5 p9 Z, ]1 u: L0 i
   Else
* z  E3 B$ t- y- s" Q     For Each key in Request.Cookies(cookie)
4 u& R6 \0 @% R; d     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ) x& s. F5 C2 A! c9 g
Cookies(cookie)(key))   7 [, E! H0 ^" X
   Next ) w7 Q: H: a8 p$ i. r7 H* T
   End If
/ l) [" \& q: d   Next </P>% v2 g/ k# G, D2 y" M
<>   tbl = MakeTable(tbl)
5 h* p) v8 g2 {! `1 E* t( D   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 5 L. Y( ^/ F6 ~4 y+ |6 L0 Z
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) . b- w3 a; s; U  o
   Response.Write replace(tmp,"|", vbcrlf)
. }0 |, m" F9 q: d1 L+ \* xend sub * b8 F8 w- E7 |  a' V
  . A' u8 ^! J; W! [- L$ z1 V& p
'*********************************************************** / m. E! _: j3 q. @. ^7 u9 V+ e
'* PrintSummaryInfo
/ J" q3 g7 A7 ]/ l8 R- Q/ Q'***********************************************************
1 c! b) f/ g* T$ j4 yPrivate Sub PrintSummaryInfo(byval DivSetNo)
8 Z* s+ Q9 U: [0 x; p% b( o   dim tmp, tbl
# Q/ u' O$ a; u  t7 q! @% |   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) , F4 D/ K% h! `
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 1 ^8 |. l) o7 e+ @. t, {
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
; D% L  F7 z% n2 @8 X7 E   tbl = AddRow(tbl, "Status Code",Response.Status)
3 u% r1 {7 ?5 L+ S   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
4 T' Z  A+ e- M9 j   tbl = MakeTable(tbl)
' t: q3 F7 R% A" c# D3 z   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) & ?7 B/ b0 D4 F4 E+ o6 F$ f+ r9 g% T
   Response.Write replace(tmp,"|", vbcrlf) ( z; j/ ]! H5 m! L8 T4 N
End Sub </P>+ t+ T1 X4 ^6 b% m, V
<>'***********************************************************
" e0 C. o+ A; _& M# @0 g( x''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 7 H; u1 c1 P# n$ K6 c3 ^. [& T- L
''@PARAM:  - oSQLDB [object]: connection-object
6 Q1 V( z/ o+ \7 R3 l8 ^'***********************************************************
& |% N/ d5 F5 g0 B. A5 j* ?' IPublic Sub GrabDatabaseInfo(byval oSQLDB)
1 B2 M+ A/ ?) f   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
& Z9 `- y8 O" S3 q7 V, S0 J/ C   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
# J" d' u) l% k6 A   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")) . |' V; _6 {  j+ {. s* O5 F4 A
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
) @, x" j8 o% D* j% CEnd Sub <>'*********************************************************** 9 E* o6 r" y# c/ N+ W' R0 L3 E9 ^
'* PrintDatabaseInfo
( W3 ?' Q: m, F/ h9 ['*********************************************************** ! @8 ~% v) Q- n2 \. s8 v( H% B; x
Private Sub PrintDatabaseInfo(byval DivSetNo)
; x- U2 L, F. S6 J1 Q5 Y   dim tbl 5 Y" ^. t! x& y6 H7 g
   tbl = MakeTable(dbg_DB_Data)
0 s5 G( z/ B. l2 s5 ~; L   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
( A+ b/ y+ s& |. g. F8 @   Response.Write replace(tbl,"|", vbcrlf)
; |8 i+ V, e! LEnd Sub </P><>'*********************************************************** . d- [- S: ^8 S7 e6 d6 O
'* PrintCollection ) \$ o2 K: T5 X1 b4 U
'***********************************************************
' B8 q0 f0 p* u0 Y, ]Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + k' I& a3 _- p9 B
   Dim vItem, tbl, Temp
* l0 m& T+ N: ?+ q1 c   For Each vItem In Collection 7 u7 ^( E8 }' c+ D, j) y# i: D
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then # a' x5 O" P4 s6 d
       tbl = AddRow(tbl, vItem, "{object}") 0 t9 O8 l5 W& F
     elseif isnull(Collection(vItem)) then 3 {: M5 {- g( z# q" T) S# z3 A
       tbl = AddRow(tbl, vItem, "{null}") 6 u" y6 d( M. |7 G
     elseif isarray(Collection(vItem)) then 2 U( M* ^& c: b, _9 C
       tbl = AddRow(tbl, vItem, "{array}")
3 t3 E) s8 \+ z1 a& F) ~! b     else # ^4 Z) h) x$ E, Q; f
       if dbg_AllVars then 2 x7 n! I! `* P! O) }5 b
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))   o" `) f; g2 M6 L: G2 F
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 9 C! s2 a- k5 M0 g$ V: r4 g
       if Collection(vItem) &lt;&gt; "" then ! ?, f9 `8 R2 b$ W
       tbl = AddRow(tbl, vItem, server.HTML) Z6 N" f* y2 }& _( C  ^& l
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 5 w8 O, ?  t8 l& \& o' L0 X/ d
       else
$ t6 `8 ?. ?) c$ M: o  `1 E       tbl = AddRow(tbl, vItem, "...") 3 X1 m+ F- C$ V
       end if & j% l+ h  N" H$ Y
     end if ; r) |' e4 l8 Y% j1 _4 |
   end if 7 ]% Q. @, k. B5 [
   Next + k; ~8 z* r/ z& i# ^, K
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 9 u# i8 S; b- D
   tbl = MakeTable(tbl) ( e% y7 N- Q$ {
   if Collection.count &lt;= 0 then DivSetNo =2
0 O4 F$ H9 E$ L     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 0 z6 }! U4 ^. k4 j( H) [
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 {" R2 J( o0 s! W  s1 n# @# N' M
     Response.Write replace(tbl,"|", vbcrlf) 9 G: T: z* [& r9 e; ?; ?
End Sub " U1 I/ G! |$ h2 u
  
  h. s& j- O3 x% V8 T6 E'*********************************************************** " p1 P4 A9 y* q6 l
'* AddRow ; `* A0 J; ]$ q0 I
'***********************************************************
1 v; @; w  v5 v- d+ Q+ APrivate Function AddRow(byval t, byval var, byval val)
: j( N/ o5 F0 m) Y   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
3 s8 C2 ?4 H2 e+ X# D   AddRow = t   |% C  n& x5 {) C$ g
End Function </P><>'*********************************************************** ! `3 P) Z# D. }2 c0 ~
'* MakeTable
. }* s/ G5 p/ ]' ]'***********************************************************
* x$ a# o* R9 GPrivate Function MakeTable(byval tdata) $ a/ {/ ?: ?* I; O: N: T& `
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 6 g$ I( Q5 z4 \0 V+ |
   MakeTable = tdata
' j3 u+ u4 [# s! LEnd Function </P><>'***********************************************************
0 i% a% V/ A9 Q8 @''@SDESCRIPTION: Draws the Debug-panel
4 E  B( v* L3 L. u; N'***********************************************************
, _" \# p) f' z+ U2 SPublic Sub draw() # G+ v( i5 N9 Y* I9 L0 ?* i. `- x
   If dbg_Enabled Then
$ {: r0 ?, V$ d( a0 T1 _     dbg_FinishTime = Now() * P, |5 q. J1 r8 p
  
5 q1 L1 y; r$ N9 \* `9 s$ K9 b- d   Dim DivSet, x ; z9 Q# L3 U9 E
   DivSet = split(dbg_Show_default,",")   Z$ c6 ?  Z9 O7 h; g, H
     dbg_Show = split(dbg_Show,",") 0 n. L  r4 N$ B8 g  S9 [' A- ^
  $ z' K' K% K) ^
   For x = 0 to ubound(dbg_Show) $ Y' w% F: ]# |& |; H9 u! X
     divSet(x) = dbg_Show(x)
$ X' _/ ?! v1 [4 F   Next 9 _+ x) x8 H; X( o7 g
  
9 S$ X" g% B0 p4 `( n- ]  o   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 A( c: n3 Q7 @' R+ t
   Call PrintSummaryInfo(divSet(0))
, j; u9 O3 r, m: t2 {4 O8 L" M* r     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
/ Y, P0 Q6 e3 i5 b. M/ d; _* V: t/ r    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, O% u4 m3 u/ U* k" M/ l) {    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 |) Q* ^+ @, f+ z2 A) E    Call PrintCookiesInfo(divSet(4))
  N, J: L% R- y. m' c  m    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))
9 w; U" I1 a; k, t# f" F) ?( I" J    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! F% U# q! U% e' L% z; n" e
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
; n8 d: J4 J* M    Call PrintDatabaseInfo(divSet(8)) 8 M' D  V, A4 t; ~1 H6 L3 l7 t) K
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
& T, J6 y% T7 c' C2 G) d" @    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ! r3 R0 Q' O( S+ I: _
    Response.Write "&lt;/Table&gt;" 7 [- a+ M! z4 z& B. e7 Y' v
   End If
- R4 w/ K4 `! g" U! B; PEnd Sub </P><>'Destructor + f* A9 Y, r9 Q" v# \
Private Sub Class_Terminate()
' w9 c# v5 e: _# @/ F   Set dbg_Data = Nothing
1 U! P( m3 m( \1 ?. s4 zEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>9 d/ }- y) I! h6 Q! p7 }- J# U
CLASS debuggingConsole ' w8 q$ N! w' J' E
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
- R- ]( S8 Q7 q9 f; J5 e  D&amp;n
% ~; d2 l' d- D2 L- Absp; 2 T6 P4 b4 S; P* f2 ]
Property Get Enabled===[bool] Gets the "enabled" value * J5 \( B3 ~& y4 m; s" {
  : {% H* K8 ~9 G7 S: j1 I
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
* U. q4 ?: O/ j% ~. w5 j& c% M5 K  5 |' S1 ]$ d7 h$ j  J
Property Get Show===[string] Gets the debugging panel. 8 C5 u% ^* N: K5 \
  % F9 G" Z" c) l. x1 ]
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><>-------------------------------------------------------------------------------- / L) u( y6 j! v6 z
Public Methods </P><>public sub===Print (label, output) , K' s8 Z) r1 y# H8 S# f/ q
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) - K8 Y& l- ?9 i! }9 \" ^
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
+ V  Y3 s; h- E; I7 E) r/ _   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- + y) x1 {4 a  p+ z0 b" `4 [/ E! v
Methods Detail
, Q4 J' ~: O7 s' v  . l. h4 V7 f& }; L8 l3 b
public sub===Print (label, output) ! j( H/ a' s8 w$ @
Parameters:  1 x1 u. G# v7 a5 D( r
   - label [string]: Description of the variable
( c9 e+ `8 [/ R6 D   - output [variable]: The variable itself ! \8 z# C5 F% o- C" }7 ~1 F
  3 o0 H, [# G2 x% F9 @
public sub===GrabDatabaseInfo (byval oSQLDB)
- z+ j4 i  s3 p6 K) jParameters:  
2 K9 |) t, A2 n   - 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-5-30 23:16 , Processed in 0.394402 second(s), 56 queries .

回顶部