QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
. x6 c. D; e) E% G1 b0 ~<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!   @4 \6 n* ?' h0 A% O
使用方法很简单:
- M: ?! `* c, o1 K. _/ Dtest.asp </P>) R+ L) s  q8 m0 b
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
  u+ b7 \* y6 W: A& {9 u. u+ U) n&lt;%
1 x! g8 W1 Q1 B- A  ~9 poutput="XXXX" 8 [' q! ~) D( S
Set debugstr = New debuggingConsole
4 z1 f+ M3 w! A7 ]debugstr.Enabled = true
  ]5 C5 G% D. T$ A9 g) |; K   debugstr.Print "参数output的值", output 5 [# B  V/ J" X! z( V1 P
   '……
% _6 Y  S$ j3 Q   debugstr.draw / o3 B* `0 Y4 G
Set debugstr = Nothing   n$ m0 K5 F1 d
%&gt; </P>
3 Y2 D; D$ }" p8 S<>=================================================== </P>
; n0 \& q9 ?: E$ W* f; a( ~& _<>debuggingConsole.asp </P>
: F& Z& j, L! X  @/ W6 n! J<>&lt;% 1 C; \; F+ Z8 D
Class debuggingConsole </P>6 e8 a$ y% @3 y; k0 k
<>   private dbg_Enabled
1 I0 ^/ a4 d$ p" m4 c3 o5 b& \$ v   private dbg_Show # h% m: R, k2 ~1 O; W. ^
   private dbg_RequestTime 1 r- j, y; K& O3 r( A* r7 ^" W# F8 M
   private dbg_FinishTime 1 r" S) E$ {" w/ l  s
   private dbg_Data : H. }, k! Q3 E5 m
   private dbg_DB_Data
: M0 @% N8 W1 S2 x1 ^+ l   private dbg_AllVars " d& b$ ]* x( ~. m* ?
   private dbg_Show_default , i+ p; ^: [* u4 N6 ?; a3 L$ p1 m9 Y
   private DivSets(2)
; }; u. s, q& |, o2 d; Q* n+ z" A: g   * H, B# R% ^, s+ f- v0 K8 T# G1 a
'Construktor =&gt; set the default values 4 [) e/ b. A) H  H* ]
Private Sub Class_Initialize()
6 @# {( p6 p4 r1 ?1 `; |9 r+ h   dbg_RequestTime = Now() ' K- c' x- s% x' v) a$ p+ x# \
   dbg_AllVars = false
9 J) t# O! {0 R6 V! `4 Y- m   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>1 Q' w! O7 I* x* g- L
<>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>) L# f& s4 J. `% U
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;( w5 S4 v* f+ c9 W; @5 c" c
&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>
/ Y7 G: A6 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>
, V! G0 n& m6 d5 [  c5 F9 S<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 0 R6 |$ i5 E$ P3 k
End Sub </P>
/ o4 W# I4 q- h; f/ Z! ]$ h<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false . T8 s" h* Z  G$ Q- _
   dbg_Enabled = bNewValue
8 L5 U9 ~, q  D  u  @1 j- ]* K& OEnd Property </P>' |& i' X/ ]3 y8 i
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
8 y9 A5 Q: K; n+ e1 l; R! Z- ]   Enabled = dbg_Enabled ; q: E( h- Q) _( Y9 P
End Property </P>
2 ^+ W7 n2 ?* U* g9 C: s/ w' e<>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 2 L7 a+ ?( \1 t1 Z
   dbg_Show = bNewValue
! n# T* V0 s. E$ D. s. nEnd Property </P>
% z- s6 }, V/ ?<>ublic Property Get Show ''[string] Gets the debugging panel.
! z  `7 j' O: ^   Show = dbg_Show
- f: u2 \$ [; |, j1 bEnd Property </P>
& D& D5 N6 ^; ~! R<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 4 G) F6 e  o8 r. J; |
   dbg_AllVars = bNewValue
$ u4 K& Z: I5 E9 OEnd Property </P>
. L  i4 g7 H! C+ o( a' s; Z<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. : a% K+ W' {7 ]9 W
   AllVars = dbg_AllVars
( P7 t- _/ G' D9 g4 r7 `! sEnd Property </P>5 ^5 C( T3 ^1 ]% E' u, v* Z! K
<>'*********************************************************** ; R2 L5 f" P8 m- W/ O0 r
''@SDESCRIPTION: Adds a variable to the debug-informations.
" `  @7 d; \# n  m) c. R: \''@PARAM:  - label [string]: Description of the variable
' M3 G+ [  u* v8 j6 u''@PARAM:  - output [variable]: The variable itself
1 k. n+ y3 I& ~6 K'***********************************************************
  H; F7 k& u5 }: S% _# d$ FPublic Sub Print(label, output)
" r( z  C( P7 }" V& [# ^   If dbg_Enabled Then : p$ E, k) ^8 v- i3 w3 u
     if err.number &gt; 0 then % B6 f+ }; z- ?, e/ a; M
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 4 I1 H  r% w8 e0 a" W9 |
       err.Clear
% h4 p& W# n/ G/ \$ W     else
; [# i6 E# T: T, u* e8 T1 T       uniqueID = ValidLabel(label) 5 S( f- S6 C% E" D) j) D
       response.write uniqueID
: v, W6 X% k1 h! E# [       call dbg_Data.Add(uniqueID, output)
' }1 Q/ a6 }4 Z4 C; f4 r: B     end if
- X/ ]: R2 `0 C6 t8 d* U8 l   End If ' x* z% n; R9 \8 ^; `7 V
End Sub 6 n& j6 j" {. {9 N
  
! ^" d# E+ T. b0 z' S3 W'*********************************************************** , H+ u7 }( s  }: H0 o0 y
'* ValidLabel 6 p- V0 V# e2 k$ q
'***********************************************************
  H. Z/ r8 s% o0 }1 lPrivate Function ValidLabel(byval label)
! \8 V% }% W. f6 G, |4 Y   dim i, lbl 4 N1 {, l. a* w% \
   i = 0
9 s5 \% E; y% U" J   lbl = label ! c% l) {! `. x* r
   do + O6 |5 U4 q$ j  u' e9 s
   if not dbg_Data.Exists(lbl) then exit do $ Q: U% H) b& K+ z
   i = i + 1
6 ^4 x& t3 z3 n2 `2 l   lbl = label &amp; "(" &amp; i &amp; ")" ( d  z( _- H' W+ d* z- O( Z
   loop until i = i
# w/ W1 C( d" _1 P$ k  
: D: U$ O2 ^6 U6 ^) Z0 r0 u; v   ValidLabel = lbl
: E! N0 R; {. K8 AEnd Function # k, Y6 `7 t$ h- b" I6 `
  
, |+ G4 ~$ M6 U5 l( S0 X$ U'*********************************************************** 4 @4 G8 }* W, ]4 a; f
'* PrintCookiesInfo
/ s3 J' U5 X: d% ~# l'*********************************************************** 7 D4 D6 w7 _( k0 W8 j
Private Sub PrintCookiesInfo(byval DivSetNo) ( X, H& T+ V$ V' B9 y4 N8 O
   dim tbl, cookie, key, tmp ( L3 e* j9 |) O5 P8 e9 v4 d5 t/ t3 w2 s3 c
   For Each cookie in Request.Cookies
, I% _" v: L4 }8 D; ^   If Not Request.Cookies(cookie).HasKeys Then
0 r  t1 I" Z7 g3 N/ Z     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
1 V: e/ l! G0 n/ Z3 b3 P   Else
* @3 u1 a- q' |' C6 h     For Each key in Request.Cookies(cookie) . b& N% @% g, C; o, \! T
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 3 o# r# x9 {8 [, Z6 W
Cookies(cookie)(key))   
: t" u& h: k+ `9 p$ a2 V0 ^   Next 4 f% D/ o$ t. N$ }1 Z% G# m
   End If
. b# a/ t( U7 _  `5 `4 {! t% o9 a   Next </P>6 ~: r9 S! t! v/ B4 Y( t
<>   tbl = MakeTable(tbl) . V1 }; }; a9 C) P/ d6 |' B' D* t+ c
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 9 L& b" y' W( X* P( o1 o/ h
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
& N! c4 l6 C6 [4 Q- l: i% Z3 J) P7 h0 G   Response.Write replace(tmp,"|", vbcrlf) & d  ^0 h5 e. g
end sub 1 O  q& @- W& u
  * |2 @6 H; L  x9 ^7 |( S
'*********************************************************** / G2 A+ r- J* x/ h& b9 g8 P$ W; M
'* PrintSummaryInfo + D. V% J5 q& x# x3 s) q
'***********************************************************
1 n7 C) s3 c4 O) {0 G! ~. HPrivate Sub PrintSummaryInfo(byval DivSetNo) 2 D# ~& m! {/ M. |1 b+ y  `
   dim tmp, tbl 8 c; W# g" _. O$ O- L5 K6 n
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 7 \6 T, T7 n1 m& A! Z5 H& k% Z
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
3 M  c7 Y8 H) O: E   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
; d  m9 Z" C* h   tbl = AddRow(tbl, "Status Code",Response.Status) , @) \& }! n/ _* h
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
8 b0 L, W) c! E   tbl = MakeTable(tbl)
! o! k# b0 U7 {( C   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) * @* Z+ ?7 J$ y* K1 F/ V2 k
   Response.Write replace(tmp,"|", vbcrlf) " |/ T; j4 }( E8 T& D
End Sub </P>
5 J9 ?6 K  X) Q2 k0 u9 n( N' I<>'*********************************************************** ! S" W! E: f1 @( x+ t
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ! Z1 ]" h" A! E) ^
''@PARAM:  - oSQLDB [object]: connection-object
# M' H( b8 U5 f3 M'***********************************************************
5 f- D' ~- l3 APublic Sub GrabDatabaseInfo(byval oSQLDB)
/ L7 l2 d/ t! D* S: @8 q0 E   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
; r" q& ~  {9 g+ g$ b2 I   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
, Q- ?0 \* L% A+ M' e   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")) 6 w; f, |2 R" a0 i; X; Q; z
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 1 c! B( Q& M: ?2 P
End Sub <>'***********************************************************
$ k- t& f+ G8 L: F7 y4 C'* PrintDatabaseInfo ( x$ i: O% E& O9 J# a' D
'***********************************************************
! }  `" y' ^3 F" \# aPrivate Sub PrintDatabaseInfo(byval DivSetNo)
: H! z3 \, t0 o% h   dim tbl
1 S7 |0 u& _+ l  ]- \   tbl = MakeTable(dbg_DB_Data)
; B7 x( K: Z+ k9 B( S) l; Y4 Y0 O   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
- N0 f6 M  A: r7 P   Response.Write replace(tbl,"|", vbcrlf) ! p! f7 |1 e, ~3 n9 r# T
End Sub </P><>'***********************************************************
2 q& n" P  V6 U+ t' l$ L( c0 c'* PrintCollection
$ L0 u. O. q, U  a2 G! M& d'***********************************************************
7 Q* K9 N  E- X5 @9 JPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 6 G) P: j8 H, J9 P( H" f0 D( t4 f$ Z! Z9 F
   Dim vItem, tbl, Temp
: w" Z6 U4 K5 d& @5 q- ]   For Each vItem In Collection " J* O* {- b5 }" j
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
: p* `  W/ |  X& \! V6 i       tbl = AddRow(tbl, vItem, "{object}") 1 W( ?  u1 R# s/ W- |. t! m
     elseif isnull(Collection(vItem)) then
+ i& }9 i5 z- J& s% `6 t3 A       tbl = AddRow(tbl, vItem, "{null}")
1 [& n; B: y4 c, d' n) C5 F     elseif isarray(Collection(vItem)) then
) c9 m' c& n" y" E/ ~4 W, X3 M       tbl = AddRow(tbl, vItem, "{array}") 3 H' X3 w/ N9 X5 q* ]' b3 v. l' d
     else
4 q5 u1 C* t+ U& o* d$ H# j       if dbg_AllVars then
, V( Z0 n$ U, n       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
; _* I! V6 [$ S! _* v$ ^2 L     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
" T" K, C5 g2 _$ U! n       if Collection(vItem) &lt;&gt; "" then ( U; [' W9 q7 _& e  O
       tbl = AddRow(tbl, vItem, server.HTML
& _+ Q$ c  h4 MEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") . f" F2 c9 H- c+ S
       else
  @2 E5 c' w; v" h& a       tbl = AddRow(tbl, vItem, "...")   Z+ w6 s1 f; m
       end if   z* F, Z4 X% c7 T! e+ K* i7 E
     end if
; |. B: e! q& F0 c2 P2 L  n   end if 7 B3 ?, Z8 P! H$ q# \. q
   Next ' y! S+ P. q* s& w$ V
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
. Y" L& n3 t  _% D* ^   tbl = MakeTable(tbl) 3 v. h( x4 @' E5 ^9 v
   if Collection.count &lt;= 0 then DivSetNo =2
6 M( x$ X9 Q* M5 ]     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) % ~; R/ I( C: P, d+ i% C' w
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
' G: {3 J; A: j( G" v5 h0 O9 a     Response.Write replace(tbl,"|", vbcrlf)
- z' n& Q2 N' B5 H2 C) VEnd Sub ) k+ D1 P  c, a- c. R7 X
  7 [7 h4 {4 O4 Z  s+ ]# e
'*********************************************************** + C; V/ ^6 U! Q3 G
'* AddRow   N5 X# b& F, L) [# R
'***********************************************************
8 n6 R7 F8 L0 L/ J. ]Private Function AddRow(byval t, byval var, byval val) / `  d5 Y( U9 b9 k! v, @9 M
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
& D! v6 l# _; J" e; f  M   AddRow = t - R' e, O! w# Q" {7 X8 j
End Function </P><>'***********************************************************
! o2 N+ r9 Z& z6 c4 o% J- N: y: O'* MakeTable
' y/ U  x: D: M4 @! F6 m! b'*********************************************************** + f- |8 ]$ {* \2 a
Private Function MakeTable(byval tdata)
( }2 F2 b* Q; `  e5 `% X   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
* Z/ l& \+ j" c8 @5 h7 U1 e   MakeTable = tdata ( i- Q! e$ g. u1 j/ b, ^6 B4 m# v1 r
End Function </P><>'*********************************************************** ' m4 I7 B6 C& H" X- `) Q! m
''@SDESCRIPTION: Draws the Debug-panel
7 H* p) I% T7 j% d# [4 b$ N5 ['***********************************************************
4 C* p; {  `: I' d$ Q- ^Public Sub draw() 6 W$ [- a: e3 c/ s- o0 L
   If dbg_Enabled Then
) n6 L9 c7 v# J! j     dbg_FinishTime = Now() % Z9 E( c4 S7 _9 ]( c' }
  
% i1 I6 Q8 }+ P3 E   Dim DivSet, x
& m7 w& i' t4 z. R0 r" {  u   DivSet = split(dbg_Show_default,",")
6 d: b$ v5 N0 \5 d7 j  z- Z     dbg_Show = split(dbg_Show,",") * h0 O3 w8 ^, s- F" y1 c
  
9 q* O0 E7 D* \& A   For x = 0 to ubound(dbg_Show) , X1 u) k2 M( y2 o5 G2 X
     divSet(x) = dbg_Show(x)
8 C; L: u; I0 o) I/ w( a& h   Next / M9 Z4 s9 H$ b  @! z
  " |5 _3 u9 s0 o- h; ~# |5 d0 R
   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;"
% }9 a6 Y- _) C0 i0 @! M   Call PrintSummaryInfo(divSet(0))
6 N1 C3 C# u2 B( k2 y3 N5 a2 v$ L     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
) a: X5 x  R2 E3 L7 y, p4 k    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 ]/ T1 f. g) m, _6 P5 m* [8 N
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
6 X5 j) c& F2 ?1 S- R    Call PrintCookiesInfo(divSet(4))
* N  {; F9 T# B  b) f    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))
2 D- ^+ v% y" {! p    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
% Y& ~8 Y: g3 @; f( M! a    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 0 d; J* z$ I+ A$ @- E
    Call PrintDatabaseInfo(divSet(8))
: w: M/ D1 K1 T; W& ^0 }    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") % S2 ~" O4 |6 \/ d! q. ?7 C
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 3 E3 y# A" s# M, |! b( B/ }6 ~
    Response.Write "&lt;/Table&gt;"
) g" l" u7 X$ i! h5 T' Z   End If 9 S* Z8 p/ U; _. m6 @4 i
End Sub </P><>'Destructor
' U) ]! r' z5 a: [Private Sub Class_Terminate() 1 F. S3 r; e. q5 `
   Set dbg_Data = Nothing 4 D7 p+ C* X$ Q( x0 v6 T7 K
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>" E: B# J# Z. n
CLASS debuggingConsole
& H" E* U) X; z3 K" O% DVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false * a7 ]- ]6 }- a0 V6 X  X
&amp;n
, X( T/ S4 h( N8 Mbsp; % W* K$ R& X0 B+ [6 y' S' e6 G' ?
Property Get Enabled===[bool] Gets the "enabled" value
6 p' w: E8 {# v4 ]  
/ Z( |% A2 y0 X- f  F3 m) C/ c5 ~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 7 c( V$ v* ?7 ^
  
6 D: ^. E5 [+ vProperty Get Show===[string] Gets the debugging panel. % N  N' [1 E; j$ P4 |$ N
  
+ H4 O$ ?* \! |/ S7 B* F' jProperty 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><>--------------------------------------------------------------------------------
) `, N1 O! A8 X4 Y, nPublic Methods </P><>public sub===Print (label, output)
+ \( |8 O' j; m   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) * h; u4 p( d( O" S+ a
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () . I: d5 t% C$ z$ k7 x
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ) C. {# @, |; p' r
Methods Detail 3 j9 D- K7 G; ?2 g
  / J4 z5 f4 C# o' F
public sub===Print (label, output)
% }7 p5 b0 ~3 sParameters:  
: e' P$ [; X5 B; `   - label [string]: Description of the variable ) N4 N- X- ?. H' A5 C  c9 T
   - output [variable]: The variable itself
2 J4 a4 U2 n/ Q$ q  ! W6 a4 P& o& M& ^& C
public sub===GrabDatabaseInfo (byval oSQLDB)
* V& ?& k% q9 e: Z# ~Parameters:  
: D8 g+ j- V, G( j1 G8 Y2 A) ]   - 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-13 17:45 , Processed in 0.473167 second(s), 57 queries .

回顶部