QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
0 f  j# l5 {3 f. K<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
3 i; g% i! w% @% z使用方法很简单:
; Z! @. w1 u4 Utest.asp </P>1 V' |5 W. F- w8 p6 B% @
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
% o8 I$ k$ y1 m) H/ O* h5 `8 e&lt;% - o7 F& l- H# P: l( C1 Y
output="XXXX" 1 T9 j0 l* a& A* q
Set debugstr = New debuggingConsole 2 w) t. Z* ?7 A; n0 H
debugstr.Enabled = true $ b- F  f* n! a
   debugstr.Print "参数output的值", output
$ \+ {! M- G% k9 h/ p   '……
+ _. H3 \4 D6 h/ {7 Z  h   debugstr.draw
) g1 T7 _9 @& X6 K9 _) F, ^Set debugstr = Nothing + h+ s/ @5 F! p. [) R- L$ L% h
%&gt; </P>
6 @  p$ V# w+ R9 G1 b+ h<>=================================================== </P>: R+ v! b  ~2 t4 I
<>debuggingConsole.asp </P>
, z8 M- h* k8 K: B7 U- n<>&lt;%
- Q1 n' s0 L/ ~: bClass debuggingConsole </P>
/ H* R7 }% P2 f% Q<>   private dbg_Enabled $ b" R2 J) g$ Q; X: r0 N
   private dbg_Show 5 A& v- C/ X& ?- y
   private dbg_RequestTime
$ v7 s8 P4 C2 ^- q3 J$ M/ P   private dbg_FinishTime ; F* _8 z" X9 i5 q) ~8 N) ?- u
   private dbg_Data " s; ~8 j, H# s7 \( @
   private dbg_DB_Data
) [4 M2 q% x" v# I8 Z8 w7 u   private dbg_AllVars
' z/ {; \, C5 [2 U2 W, X$ @4 l! ]   private dbg_Show_default
: c# V- p( f8 W' Y   private DivSets(2) 1 s" x: J- M) a5 q
   
$ _- B$ r1 O! q4 `9 J- Y'Construktor =&gt; set the default values 0 _# x( `) c0 Y6 ~& j6 E# g* Y
Private Sub Class_Initialize()
0 b, x, T6 ~& q' p0 Z! v   dbg_RequestTime = Now() 1 T- Q: ^( z* ]9 L# w+ G
   dbg_AllVars = false
9 f; i; e" P4 x% I   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
2 [0 `# _4 M/ D" \" t<>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>  K3 x3 R2 W7 `8 y3 v. n
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;7 O& n9 W# x2 R) \4 [
&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>2 |3 M+ Q7 ~9 p0 R' H3 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>
& V9 v% ?5 a: t/ y<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 8 z" P- Q% ^& l
End Sub </P>+ L* m0 L4 P0 X$ |0 Z8 u
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
$ G2 t* v1 o9 E6 Y1 Q* l/ G" a   dbg_Enabled = bNewValue
- }' ]& j* z8 z9 a6 zEnd Property </P>
/ _! s% A( r7 N<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
0 A3 ^' t5 Q6 u% [# A% M   Enabled = dbg_Enabled 0 {! U) W/ _5 v  R) y
End Property </P># Q  Z; [# x; v  q, Z- M( F
<>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 ) w8 V) @# w6 N& f. D
   dbg_Show = bNewValue
" U0 A1 T# r) R: F  P1 OEnd Property </P>, R6 L5 P- c1 J" H, ~
<>ublic Property Get Show ''[string] Gets the debugging panel.
+ g$ G4 l6 e! V8 q4 p! a& [   Show = dbg_Show : |; Q: L7 F1 `1 A/ q
End Property </P>
% e- S5 t6 J: F8 w9 G<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
, q5 i( V! ]& H   dbg_AllVars = bNewValue 6 C- N7 M& j2 c% M: g1 R! Y
End Property </P>$ ?* T4 N6 x9 T6 ]3 N2 q7 B, t. q
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
! g" L" w; |/ f, D9 B0 k   AllVars = dbg_AllVars
% o7 t8 u% @" B3 H4 `End Property </P>
9 I2 X2 v) \! y: U<>'*********************************************************** ; _" h7 ]# d) g8 ]3 t
''@SDESCRIPTION: Adds a variable to the debug-informations. 6 R- z1 n) [+ y! l- c
''@PARAM:  - label [string]: Description of the variable 3 m# I0 y# \% x% C5 q! d7 m
''@PARAM:  - output [variable]: The variable itself
: z/ @0 }6 l3 b% r0 j'***********************************************************
- {8 |5 z( \+ F0 m: ^" yPublic Sub Print(label, output) + S8 t! @5 M. V& E, ?  r
   If dbg_Enabled Then , X; W3 `7 W( n
     if err.number &gt; 0 then
# v* o# J. k2 f# C3 q0 Q5 W/ }* f       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) % g# w, j# K. Y
       err.Clear
4 S4 [2 m7 ]. n' p* y  q1 @     else , Q- |& ]5 n6 b7 ~7 Y
       uniqueID = ValidLabel(label) 6 }% f3 p0 B( [
       response.write uniqueID
; s4 L; e" Y* F) m" n, ]6 a       call dbg_Data.Add(uniqueID, output)
/ ?& m+ P4 S5 p( y2 ]4 Q     end if - I9 o0 s- k& ?1 v* w& `
   End If
; _) C$ f4 r, v3 r1 rEnd Sub
: ^' I& H) {+ D7 ~5 n2 f  % f. Y" F8 ?% p8 b
'***********************************************************
* J% i3 Z7 }& H* B'* ValidLabel 4 o9 j2 H. J/ z
'***********************************************************
) u4 }6 z* v8 B# x6 Y) y) DPrivate Function ValidLabel(byval label)
- y0 t: U* e- ^$ z& f1 z( H! f$ g   dim i, lbl
8 D* f& {6 {; `2 v   i = 0 # k; Z  l$ \4 r
   lbl = label 9 e; U6 O& c+ N4 z3 n- @( z
   do * J1 l5 y+ T8 `' E
   if not dbg_Data.Exists(lbl) then exit do 7 A1 {7 o7 j+ G1 m+ Y
   i = i + 1
# l; t  D* T) O) N& b; r   lbl = label &amp; "(" &amp; i &amp; ")"
* M0 t0 z  c5 h5 H: j6 S2 o   loop until i = i
2 `% u) j. L+ H* Y/ A  
( D# h1 j: F; B7 }- D   ValidLabel = lbl
3 H9 @7 ]8 e# ]8 L( k* fEnd Function ( e! `. t. V( C4 \
  0 p- ~) g* ^0 Z# U+ ^
'***********************************************************
+ {$ T4 V3 b0 ]) K0 F6 c'* PrintCookiesInfo ) J$ |, P" t+ D" e  q
'*********************************************************** 4 x& j9 b8 {: N6 s! Z* U
Private Sub PrintCookiesInfo(byval DivSetNo) * O7 }, i, s" ^; P
   dim tbl, cookie, key, tmp
9 y% @9 M, B! S# f* }, n  H) D   For Each cookie in Request.Cookies
. Z5 X9 N+ |/ Y' U" w- y   If Not Request.Cookies(cookie).HasKeys Then
$ j6 N1 W* W5 ]' z8 b' q' m/ t     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
0 E2 e& b! [* b* h! b6 g+ u   Else / h* _/ A( _1 h! t5 s/ u% I
     For Each key in Request.Cookies(cookie) - @  i! h) [2 I3 J3 ?
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. & p6 K, o0 U  K5 N, R* w- Z$ J" P
Cookies(cookie)(key))   
) D  ?+ B! A! I5 y0 e; x   Next ; H1 G) l; @& j
   End If ! H- A* Z+ t+ {0 D3 k3 U3 ]. A
   Next </P>
' ^& L( ?1 G+ R<>   tbl = MakeTable(tbl) ; P3 Q/ Z" r. J7 ]& n" W' x" [
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
& g1 a* a, B3 E+ a8 F/ D  a   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 3 s/ T( k4 y) y; W# t
   Response.Write replace(tmp,"|", vbcrlf)
3 f: _9 }# p" f3 K1 s6 g; K% W% Vend sub
# `8 r4 W" V: P& R/ J  
3 A7 p" Y9 O4 |) u'*********************************************************** 8 e; v0 j* j8 Z* ]+ P& O
'* PrintSummaryInfo
0 R3 c2 R- v2 G' A2 P- c0 D'*********************************************************** ! O$ O- j2 p/ v8 p7 Y1 Q  S
Private Sub PrintSummaryInfo(byval DivSetNo)
% [4 F9 C! R! @8 i0 N) t2 v   dim tmp, tbl
7 k) l1 U; [! y+ a" A! Q6 o  [3 n   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
! A$ n3 E  S% l* B; }   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 9 h) O8 f1 h- K% V
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
2 _  |8 N" u5 m7 b7 {+ R; z: ^   tbl = AddRow(tbl, "Status Code",Response.Status) ; s1 G6 I* p' a/ k; {( y# `" j5 c
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
# A6 f) J3 [' p( ^   tbl = MakeTable(tbl) ; }+ n) X0 |0 d7 y; O( N
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) & u$ O7 I, e) _+ H/ `
   Response.Write replace(tmp,"|", vbcrlf)   j/ ]4 n$ R  [8 g' @
End Sub </P>
+ N* Z  j% J) h<>'***********************************************************
% U3 W: D& ]3 h3 v* y0 L''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
% s- I! _) y8 U  D$ I- [$ N$ P* @" k''@PARAM:  - oSQLDB [object]: connection-object 4 |! T* y* j5 I
'***********************************************************
8 Z6 p- E% {1 bPublic Sub GrabDatabaseInfo(byval oSQLDB) 5 e. y( N( Y: r# R
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 4 c( h; r' [" v( {  k
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
/ x4 C% ^9 v. G8 f4 i. T# b* B  z   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"))
. l% a( [9 ~' ?9 D+ H6 H' L0 g   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ) n! @. g) {% _; X: s; T# N6 t
End Sub <>'***********************************************************
' J; O! ~( i7 c, c$ A% }'* PrintDatabaseInfo
2 H9 V0 N9 @! F2 P5 Q+ o' I( S7 C'***********************************************************
' z5 [. i8 ?. _3 B! n9 U7 PPrivate Sub PrintDatabaseInfo(byval DivSetNo)
) F0 Q5 ]& U: C% |) b) U. U) |   dim tbl
2 O7 x, [& Y& ~7 M   tbl = MakeTable(dbg_DB_Data) : @' j5 f9 \. ^2 h+ u6 K6 v0 X
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 l, R; f% o- ~' |3 Z   Response.Write replace(tbl,"|", vbcrlf)
( z3 d$ O# S& R5 L5 Y) b: F2 ZEnd Sub </P><>'***********************************************************
! ^' F5 m8 m% w& N: }) F/ I'* PrintCollection $ S  n% \+ g$ W3 A- [1 {! Q
'***********************************************************
. }* i- s* S6 ~: F7 p# r3 J' {  uPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& o5 v5 p6 o' Y   Dim vItem, tbl, Temp
' M; F! p1 w8 e& l, A   For Each vItem In Collection % T& i* w- a7 A( p% z% f; p/ a
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
0 D& |) m1 D. h5 k/ w9 c: a       tbl = AddRow(tbl, vItem, "{object}") * Y0 G% s# R: Z. T+ u: E
     elseif isnull(Collection(vItem)) then 4 m* M+ q1 W7 l9 V" u0 I
       tbl = AddRow(tbl, vItem, "{null}") 1 {% Z3 b0 H+ H0 B. t5 Y+ l
     elseif isarray(Collection(vItem)) then 3 X7 s4 g" s0 U" q. Y
       tbl = AddRow(tbl, vItem, "{array}")
+ Q4 ?% |+ j9 J4 m" z0 C3 `5 `: I2 O     else
  q+ k& s/ [' G7 Y/ y7 F       if dbg_AllVars then * o6 V2 d2 _; c6 t( V
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ! Z9 d9 l; _7 ?3 O3 B6 o0 n- t
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 5 _% R0 ~9 I) k% J
       if Collection(vItem) &lt;&gt; "" then
/ N2 e: Y7 D# q" Q' }5 F/ k7 e+ o       tbl = AddRow(tbl, vItem, server.HTML- Y  G4 U8 G8 F2 l
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ; X! `, w6 l6 J* I& h
       else
  W: p2 E; a* ~1 v+ r2 }       tbl = AddRow(tbl, vItem, "...") , U+ K, i- @, k' l
       end if 5 y& V; t8 C  w! _+ k. `/ J
     end if . k$ S2 \+ w! R, ~/ E
   end if
; b% }' r+ X) w4 m   Next ; k; {- E. ~- L0 \# E! f; R" [
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ( z; D/ W- k4 F1 B2 }, r+ }5 f2 p/ m
   tbl = MakeTable(tbl)
5 ]( J7 K( ?" m# e1 B; N   if Collection.count &lt;= 0 then DivSetNo =2
- E0 W! @9 @* {6 w" A0 z. ^* W) U     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) # u" P. z5 Y% a3 U0 J2 ^: C
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 e( ?$ a+ c! ~* E. z
     Response.Write replace(tbl,"|", vbcrlf) 7 N( ?+ G: p  d0 x: I
End Sub
9 G( t2 z* E/ w. }& z  G  O  1 x/ v/ ?& S  T: X- h! B
'*********************************************************** " Y/ F# T; ?  `3 u; ?
'* AddRow . C  M& L4 N  ^. L9 N# r4 M
'***********************************************************
9 H, ~6 w" c( _8 IPrivate Function AddRow(byval t, byval var, byval val) . U3 Q' }; m+ c/ r+ B( E
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" : x1 y  }# d" p0 ^6 n: e$ v* n
   AddRow = t ; J3 i; W- l/ S, f
End Function </P><>'*********************************************************** / L8 M- S- T+ Y
'* MakeTable , B% G8 G' j8 [
'*********************************************************** - ^! C4 e' q9 `- U/ r' \% ]
Private Function MakeTable(byval tdata)
0 ?* B: X5 J( ?  ]* L, l   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
8 C) ^% W  p9 y- E* t% A  n   MakeTable = tdata
/ i& z% [) I3 m' Y+ h! qEnd Function </P><>'***********************************************************
8 \4 x3 d$ S, t9 L4 t2 X4 T''@SDESCRIPTION: Draws the Debug-panel & ^# l; o* L+ t' F. r3 U4 p
'***********************************************************
& Z6 x) z2 ?0 F$ \5 {  APublic Sub draw() 1 `- i% p5 U2 D5 N. P* k( \
   If dbg_Enabled Then
9 _1 J" V! ]  ~- T     dbg_FinishTime = Now() 1 T* q" b5 C+ W0 ?$ C. o2 s
  ) V# ~) X5 i2 T& ]% R6 U
   Dim DivSet, x
* E+ d9 j/ X, [0 L$ e' \   DivSet = split(dbg_Show_default,",")
1 C# M2 N) d1 X5 G3 B4 I     dbg_Show = split(dbg_Show,",") & _5 A' H8 B& p
  
% f7 Z9 K) _1 m1 P( f2 J' H   For x = 0 to ubound(dbg_Show) ; {+ L  Z+ X  _9 ^( T! y
     divSet(x) = dbg_Show(x)
+ Q. E- Q3 z3 W% k* H6 y   Next 8 L$ Y- a2 r; l9 D" ]
  
6 H! u# L7 g! P# U1 T   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;" / o# I  v: G# V, x* `# F( C
   Call PrintSummaryInfo(divSet(0))
/ b- r& t) p+ Q* a+ J$ v3 q     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") * t. i* i1 z% N" G& }
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ }$ x# @& g  b7 c- e    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 O7 `; x4 o7 G% Q7 H$ k) A4 \    Call PrintCookiesInfo(divSet(4)) 5 P- n# L! P2 ?" H: l; e+ _
    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))
% C( Y* [: ^3 D2 c    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) t5 P/ e" h1 J% a7 p' V$ K% u# [
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& Q4 Z1 S/ m" W) s    Call PrintDatabaseInfo(divSet(8)) 3 e) c4 \- z" u: C$ j
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- Q, X6 i$ r4 s0 i! E# B4 [* q: [  }    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
7 Z8 z/ ]) m, s9 Q    Response.Write "&lt;/Table&gt;" 4 I6 f1 S  y& ~, ?: q0 h( }! b" [
   End If ' }* D+ |2 T7 X# t) |% T
End Sub </P><>'Destructor ' c0 }: j1 R1 d- P
Private Sub Class_Terminate()
1 X1 b0 }, X2 m; J: V   Set dbg_Data = Nothing $ R% ?5 z( O) p( Z5 n
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
# n" A3 g6 L& @# r9 mCLASS debuggingConsole
* x5 s8 _6 f+ u2 |. ^9 I3 oVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . Y" F; A$ c% M3 ^& V6 C
&amp;n5 _) l5 v1 {5 T+ t4 q) `
bsp;
3 v8 c3 f, `; QProperty Get Enabled===[bool] Gets the "enabled" value
  p' @& s4 J+ ~  
/ ^$ U! g+ n9 n2 |2 gProperty 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 g3 y- U; \( e2 Y: M$ `8 K0 G( O) t  4 F) w. s8 n* X( c6 E
Property Get Show===[string] Gets the debugging panel.
$ M& Y1 U8 L9 k) o: i* U" \5 b  4 Z- p/ D0 T1 Q2 J' Q3 M
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><>-------------------------------------------------------------------------------- / ?% S0 u0 y+ G! O1 h8 [. M
Public Methods </P><>public sub===Print (label, output) : Y/ }3 h2 B+ \8 R
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) / ?, V+ a0 {! ^7 C4 `3 ?
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () + c8 b) ]0 H0 F  |2 r8 g+ R2 Q
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- " u7 s8 Z# K4 P! p/ U) w
Methods Detail
% l3 K( V5 `8 a" l  
7 u2 U' a# V# d1 E  o3 H  E) ppublic sub===Print (label, output)
. |2 h* d% o: O2 O8 _& lParameters:  8 t  [# q' a( D1 ^* I2 F6 G
   - label [string]: Description of the variable
3 u* m) F7 ]' u$ J# c- u( w+ x0 E   - output [variable]: The variable itself - H/ ~3 Q4 C+ `  d# Y
  ( i" E8 T+ ^7 r( v! H
public sub===GrabDatabaseInfo (byval oSQLDB)
4 T) r) L  U3 u, q8 S6 E7 dParameters:  # l7 E( }5 |3 L  [+ n, J7 d) V
   - 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, 2024-4-26 06:02 , Processed in 0.357303 second(s), 56 queries .

回顶部