QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
( ?* ^. y) ~& f  P" x<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ; j5 Q* V/ ]! Q" ?# P/ E1 W/ q9 D* r
使用方法很简单:
7 e  m" d7 ~# m1 l5 Ktest.asp </P>
  a8 O1 x2 F+ I( i2 J2 g3 k* ~<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ( ^+ \$ H! q* B8 P0 o( C
&lt;%
& g& l1 y4 x/ A$ Z6 [. M8 houtput="XXXX" , ?9 D9 x4 c5 }. ]0 X- x
Set debugstr = New debuggingConsole
! q$ S0 G* ?( j% b) u& o; `$ k( Idebugstr.Enabled = true
0 H' A# W0 C% a$ ~, E   debugstr.Print "参数output的值", output ) j" x( I. [( ]  g/ N1 R: Y/ G3 x
   '……
# O; O' a4 V3 f; [   debugstr.draw
* Y/ q5 n) Y2 j: z* ?/ \Set debugstr = Nothing
& j8 k, w% j$ E" k6 s: }/ r0 F. I%&gt; </P>6 T8 _) u7 G7 h9 G! l) i5 G
<>=================================================== </P>
  n/ y* G1 N' J! E4 |, s# q* Q$ c0 {<>debuggingConsole.asp </P>" ?8 I% ~) r, f8 y1 V8 S
<>&lt;% % J; K8 u0 r. I
Class debuggingConsole </P>3 M0 a* Y0 [  y3 M0 q) d& m
<>   private dbg_Enabled
  e4 ]/ \& B" v; v# c. U* c) H: k   private dbg_Show ) [9 A, C0 l2 u5 U
   private dbg_RequestTime
( a9 S; m! r$ J; b   private dbg_FinishTime & s9 d- N( S4 O: T5 A0 \* J  R- h( I5 N
   private dbg_Data
# I- [, t% B8 M. m% i   private dbg_DB_Data
# y, z6 D2 t7 r" x/ Q   private dbg_AllVars ' [. |/ p) N; d% ?2 H
   private dbg_Show_default / ], t& g" l) h9 g% r9 m" w# p2 o
   private DivSets(2)
6 ~  z7 P5 p4 y! L   " Q$ |( ]. c4 U; X3 J
'Construktor =&gt; set the default values & k* M3 _% R5 q9 p
Private Sub Class_Initialize() ' B, |- p+ S0 K8 a& {, u2 _- ]
   dbg_RequestTime = Now() + c. x. d1 f6 P8 C" ?7 H/ I" f' R
   dbg_AllVars = false
- l0 K8 E8 Y/ [8 }+ b9 |/ M+ q6 ?- [   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>* R9 N/ P& l' W
<>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>( j* m& j* b! w4 {# e% F
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
% n. f) T/ X0 K" N$ i( t, 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>
% S* |% V: R; i/ c$ X+ 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>8 S; G& I9 n. z7 E5 i/ y' s- x" T
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
; i2 }- n7 v* ZEnd Sub </P>
7 A2 X9 I$ Y' G4 c<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
; k  |$ L4 D/ w. s, F. l: w   dbg_Enabled = bNewValue
8 w* X2 N, Z$ v! W/ Y( X7 {0 J8 uEnd Property </P>9 q  {9 [( H) g5 ^6 S
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value * B' k1 t- P/ b( }* J4 [$ J
   Enabled = dbg_Enabled
5 Z: b* z* f1 E/ fEnd Property </P>
6 G6 U" T' Q2 r& C! P<>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
5 r3 z* ~( V! Q+ |/ L. Z' B   dbg_Show = bNewValue
2 o  G8 ]% \% P$ s! U- Z3 ^End Property </P>! Y- o0 X- [+ @4 P
<>ublic Property Get Show ''[string] Gets the debugging panel.
: i' \3 M+ \- B7 W, {3 V   Show = dbg_Show
: |1 B- ?5 I+ X% [End Property </P>
* M+ z+ R( O, K7 h<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ' ]) y4 g4 C! Z; V' e: f- m' f8 t
   dbg_AllVars = bNewValue 9 |# Q" H% j2 z' \2 W/ C+ {
End Property </P>
& C; A6 x* ]6 k<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
9 d1 e8 p0 T" g3 q   AllVars = dbg_AllVars % z$ q: q- d) R  h5 C4 }' l9 e# j
End Property </P>
6 ^$ n4 g7 M8 N, b<>'***********************************************************
4 `3 Z0 s  x* S& W''@SDESCRIPTION: Adds a variable to the debug-informations.
& R1 g& f3 `% u''@PARAM:  - label [string]: Description of the variable # z! o$ _3 B  t
''@PARAM:  - output [variable]: The variable itself ; p" \+ l7 G8 n; u- ^4 t" i
'***********************************************************
  D! r' w* U# Y# TPublic Sub Print(label, output) ; g! b6 ^3 m: N7 I3 i, x) `, R
   If dbg_Enabled Then
" b+ F9 ~. t" `# b" Q9 A     if err.number &gt; 0 then 6 V; x- b' k* _6 m* d" l6 c2 H  B
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
& a/ t$ V( n2 S5 f5 }6 X       err.Clear / Q; h5 S  h" j
     else
* H! j5 o( ?- L& M8 O  W       uniqueID = ValidLabel(label) % m; w" j/ \' V7 u) {: N/ a
       response.write uniqueID 1 M" n9 t) A# T
       call dbg_Data.Add(uniqueID, output)
1 g& }, h) D8 {1 p7 s6 c% j3 m7 ~7 u     end if
4 o( e& ~# s; N& G" |   End If
% t/ T" I3 G4 K) ?End Sub
, b# v0 W! N, @8 {8 C  
; N  n) `) o" T'*********************************************************** 4 N7 l; L* [& D
'* ValidLabel ' W( k) q( |' E! f' d8 X1 c, d
'***********************************************************
. m+ K7 _: Y6 u( d/ s* hPrivate Function ValidLabel(byval label) ' [" e; ?& o6 O6 J8 p
   dim i, lbl & h! Q6 ^4 e& d
   i = 0 / v8 a' s! h, h  c
   lbl = label
: u& K7 ?! ?; p7 q9 v1 X   do 6 K; p+ q$ R0 U- o) U
   if not dbg_Data.Exists(lbl) then exit do
: {. y' _# w  E8 y   i = i + 1
( ?' g  m; J4 {3 V, a2 @   lbl = label &amp; "(" &amp; i &amp; ")" 5 T* A4 q+ n+ b9 ?4 h# V  x
   loop until i = i # A5 ?' L* m  m1 p
  0 T% F- e) p! ?$ u
   ValidLabel = lbl
: U' l4 b. i/ T7 Q# v8 vEnd Function
! {# @! ]: {# b3 ?; c' t, T  
3 f. {' q4 k# {0 o4 N'***********************************************************
: s& B+ S/ \8 C3 B$ \% y'* PrintCookiesInfo
) s  [  M0 n* g  C+ V& e, l'*********************************************************** & B' [. `" h- l' ]
Private Sub PrintCookiesInfo(byval DivSetNo)
9 v* Q9 I2 t; p/ y   dim tbl, cookie, key, tmp
$ G5 \; e+ v- @- Z   For Each cookie in Request.Cookies : [/ H: k4 f; f2 Q2 ]# F
   If Not Request.Cookies(cookie).HasKeys Then
1 R- \, n' N8 {& [2 }2 E% |     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
( Q! C2 b9 E8 l1 @  m   Else
* p/ k. I) f: V' m! S: B     For Each key in Request.Cookies(cookie) " \+ {& m6 b/ D# h
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
- q3 |, `- I, T( v% K+ I/ aCookies(cookie)(key))   
& m7 D9 [0 }8 Z   Next $ c1 J/ ]* `0 s/ P* K% n
   End If
: O% y7 q$ w% P$ l( t   Next </P>
/ N' L; \6 w5 Q% R, Z6 F<>   tbl = MakeTable(tbl)
  J2 B* f) @2 E( j. |   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
6 k, ?2 h4 C9 q. g/ P' M. w   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) : Q& I; M  ?! S" ^: F% t0 U/ Y
   Response.Write replace(tmp,"|", vbcrlf) 9 @7 @8 H+ R4 y& H
end sub
: E* [  ]( J7 I1 Q, P  
7 Z/ w/ {$ }3 \' U. J'*********************************************************** ) W3 R6 [9 T2 X% @$ K
'* PrintSummaryInfo 3 H; ^- K$ ~$ T" ^
'***********************************************************
* H7 K$ {1 d2 u. a6 w* c3 v5 xPrivate Sub PrintSummaryInfo(byval DivSetNo)
( t4 K7 C6 J8 Q6 l5 e" L2 e   dim tmp, tbl
! |% S3 Z& a- Z; \) i* Z, ]% Z   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) " R) n& E+ G" a
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ; a# @* S  D" F; I$ }3 c
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
  m2 t8 U; Y( {' K5 h   tbl = AddRow(tbl, "Status Code",Response.Status)
# }3 E* K2 ^# h1 X5 w   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ( E' C' |% R/ [- E
   tbl = MakeTable(tbl)
% x- e- p1 C) P- M   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 0 B6 m8 V% C3 {' T
   Response.Write replace(tmp,"|", vbcrlf) ; e6 H2 z& g* ?- \) D0 ^: d
End Sub </P>
# v& p/ L/ H  P: f, n<>'*********************************************************** 0 B! T% O6 U3 w5 ]6 B
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ) B4 K9 [, Z  j) L
''@PARAM:  - oSQLDB [object]: connection-object
7 O# X  H4 ^9 |! L. f% @'***********************************************************
) E  ~: G% {* l$ ]; X. HPublic Sub GrabDatabaseInfo(byval oSQLDB)
" J( N. k3 ?! S+ [' U2 D7 N   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
7 [! E9 r% j' ~2 v7 y+ j8 I- r1 \   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 1 `2 w3 Q3 {5 d$ c! U/ ]8 G5 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")) 1 v8 l  n8 w7 @9 B9 |1 ?7 t& w3 q
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
2 r5 I' g* |- wEnd Sub <>'*********************************************************** 8 ~  D/ ~+ l9 g# y0 Z
'* PrintDatabaseInfo 0 z% S' Z8 A# \8 ]
'*********************************************************** : }: ]6 V0 v$ s' c, a. D
Private Sub PrintDatabaseInfo(byval DivSetNo) / y/ I/ G' i" [. F4 K- ~6 C
   dim tbl
: B+ o$ v- R& C7 F( W   tbl = MakeTable(dbg_DB_Data)
& T6 Z$ l3 P. s8 o   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & Q) S; w" L* ~$ m: J  Q( Y
   Response.Write replace(tbl,"|", vbcrlf)
) q; j$ ^. f. j+ T; W# t4 BEnd Sub </P><>'***********************************************************
+ ?6 L4 h* x1 `5 [# Q$ S'* PrintCollection ' K4 g$ @' @8 t, @! U. `" a
'***********************************************************
. Y, X/ d* h' tPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ! \. t, I, v/ ^* J6 @! v
   Dim vItem, tbl, Temp
5 z$ f  d& z% O" T   For Each vItem In Collection
: `5 R. a; F- T* I     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then * S; o! H3 X* m6 W: ?( i3 s
       tbl = AddRow(tbl, vItem, "{object}") , n2 g9 u9 m+ {- Z$ H- G5 w7 D/ s
     elseif isnull(Collection(vItem)) then
% G, {. |3 `9 L) z7 ?       tbl = AddRow(tbl, vItem, "{null}")
0 l  \: a% z9 P4 {  w+ _     elseif isarray(Collection(vItem)) then
2 E3 H1 w+ q9 I  O; J       tbl = AddRow(tbl, vItem, "{array}")
* [% J4 j6 K. U/ ]* q7 _1 s     else 2 n( R# x6 K+ ^" m- G) |# k- x
       if dbg_AllVars then
! J& W( q' b* Y       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
+ \2 Y0 ~# t; s; T/ q9 }; l     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 9 h0 \6 U2 v- _
       if Collection(vItem) &lt;&gt; "" then 3 d8 g6 |8 K( Q, M7 F2 b, L8 |
       tbl = AddRow(tbl, vItem, server.HTML
1 ]7 a! g- c4 G0 G: eEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")   V9 V1 c! M# i. H
       else
% g# Q  Q. u. x3 Y/ G& N       tbl = AddRow(tbl, vItem, "...")
* Z3 m1 u  Y+ l& M* T; |       end if 7 O( {. k+ |1 a# O5 n" q
     end if
, j0 P# Q) {2 C# |; r" o2 G/ }   end if
5 B; ]" E; X# k2 _   Next
) M1 ?- W( F% _* W8 x9 Y; \   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
* H1 [4 c5 s8 Q8 |# a   tbl = MakeTable(tbl) ) y- A/ I) N* G2 @0 Z
   if Collection.count &lt;= 0 then DivSetNo =2 4 A& M' b" s2 m' o
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
2 r& o8 l& x+ W     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
5 p; A. i: D" A* i     Response.Write replace(tbl,"|", vbcrlf)
1 j+ r% M: W( x% I$ V0 K& T' xEnd Sub 6 u( V9 o6 Y; d3 Q( h
  
5 Y6 G! x7 L) k/ U: l; C'*********************************************************** , G# m8 _- z8 g8 y0 ]: [
'* AddRow
# Z: p9 R. t1 e+ Q2 q, Q* Z' a. N'***********************************************************
! c$ b$ x; a( g: T, KPrivate Function AddRow(byval t, byval var, byval val) ; B0 c, p+ x1 W# V) Q0 @
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
* K$ E8 b7 a- E! G8 Q: |   AddRow = t
# h$ r$ `5 T0 ^& M% g6 T& B8 i; k3 Z7 rEnd Function </P><>'*********************************************************** & Y; H+ n( s) f
'* MakeTable
" \' R% t8 f# k# r7 c  O5 |; h5 s'*********************************************************** + D7 p4 K" G, e8 \! P4 _( I' @1 [
Private Function MakeTable(byval tdata) : c2 H/ L4 g+ L% L) c) ]" S0 b* u
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
: r" [/ Y' V9 `) W$ O. {4 G& z   MakeTable = tdata
" K$ N, \( Q( ?& v' sEnd Function </P><>'*********************************************************** $ }2 y6 N# |* o& O
''@SDESCRIPTION: Draws the Debug-panel
- H& b0 H. x' L3 a$ M4 V# H'*********************************************************** # O2 v% V! L% j
Public Sub draw()
/ M. x3 g) u6 s  E! x; V   If dbg_Enabled Then
$ a# p- R2 X( X     dbg_FinishTime = Now() : L  H( N2 e# ~' n6 _
  
9 x8 E: D! v- n: n+ G) \, y% M   Dim DivSet, x 2 G- k7 b5 ]; S0 C$ ^1 D% n
   DivSet = split(dbg_Show_default,",") # \7 m6 `( o4 z! L
     dbg_Show = split(dbg_Show,",") 3 ~* r  g* w/ h, ?- t, A8 s
  * ~- p$ {* Z! S" m* d
   For x = 0 to ubound(dbg_Show)
; k7 d* M4 B+ }/ ?  [! l     divSet(x) = dbg_Show(x) * Z' ^) U- W8 Y4 J* L- U3 J4 a# \7 y0 d
   Next
- D% r' Q* o% J  q: e, E  : L" S: ?4 r- \: n8 U# A) 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;"
- l$ y3 m" f3 g   Call PrintSummaryInfo(divSet(0)) # d5 w% X# U# X% R" {1 U
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 J# N; [8 _4 c  @+ V! n5 Y
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 T, }! m# w6 Q# ]$ i
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 7 v- P' o# \1 }( V
    Call PrintCookiesInfo(divSet(4)) - c( V7 s  g! @+ J9 P& N
    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 R. k+ F. Z* m9 [9 f% H
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) q5 q9 W+ c- q( ~( Q) v
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
$ q2 y# }2 w" q8 t5 v    Call PrintDatabaseInfo(divSet(8))
, g1 i1 V& d& M* ]( x( x3 _    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") % R9 {( |; b7 ]3 Z
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
3 s7 m9 y  C* J# b+ u. F& H/ U0 q    Response.Write "&lt;/Table&gt;"
% q4 l: `7 _; k7 S- B   End If 4 W/ O3 Q2 A4 c% e; V9 ~; r5 b5 V1 C) i
End Sub </P><>'Destructor
4 `5 C# s  D7 s7 w1 W4 hPrivate Sub Class_Terminate() ; k9 R5 Y$ m0 S: _
   Set dbg_Data = Nothing
- p$ t# E4 g5 R9 mEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>6 U! M# ?$ s: \- m, e
CLASS debuggingConsole % e8 Z, B# f5 z
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
& j! G9 _3 a, V, t/ e2 y&amp;n& o0 t" G+ O0 d
bsp; 6 E! S  V5 G7 P1 I( m
Property Get Enabled===[bool] Gets the "enabled" value
* i) ]- k6 i0 b  c9 d  / T0 R/ O/ F) u  r" {
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( G) ~# `. [  ?  
3 f" Q$ \' g/ A( t7 l2 |- KProperty Get Show===[string] Gets the debugging panel.
* u- t, L1 k4 B  
  {% q5 L( _4 @, L2 uProperty 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) q7 m" z1 h% tPublic Methods </P><>public sub===Print (label, output) $ S" Y1 ~. T7 C- f5 N7 c& A6 r
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) / U* a& x1 {- X- i; ^
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
+ a) {! ?5 P9 J! D   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ; W  k0 F4 r# @, M) H% p' U
Methods Detail * K+ \8 z/ \5 B% c9 y) r& B
  
% x0 \9 h( Q. @+ u4 \+ upublic sub===Print (label, output) * n2 R$ S2 W- h. {( C
Parameters:  ! Q  {0 ~" ]5 k- n4 c/ v
   - label [string]: Description of the variable
/ B. e7 m* a5 G) m. L   - output [variable]: The variable itself
# p! b. Y, b& @2 E( J4 ]2 n  
: b; ]2 V/ ~! @3 @" X- Mpublic sub===GrabDatabaseInfo (byval oSQLDB)
4 i3 v- ^5 M! z6 t4 gParameters:  8 |# M8 |( l) Q( ?
   - 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-11-20 07:08 , Processed in 1.161371 second(s), 56 queries .

回顶部