QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>. L; T4 A6 ]1 X- ]: w
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ' [% @3 ^' l' `2 @* L0 A$ _
使用方法很简单:
0 A# p$ x( O% y1 G( f, `5 Ktest.asp </P>1 ?- k# L, B+ w6 P. ]
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; & o+ h" M, d7 \, A9 [
&lt;%
( Q5 S1 o. R: r( t- boutput="XXXX"
: B& _$ `9 @. T. M" FSet debugstr = New debuggingConsole
# W* O1 f' g9 o! }6 |9 n  y2 Fdebugstr.Enabled = true
, a/ E8 B0 Y/ R0 T   debugstr.Print "参数output的值", output 6 x) A! u) c/ ~3 E2 g
   '……
: O) Z6 p9 c2 t- K9 y( j; V   debugstr.draw
- h9 c) J% p4 sSet debugstr = Nothing
' i/ S! `# e7 C6 y$ Q%&gt; </P>
3 i% z3 G4 g2 `' x0 V; W<>=================================================== </P>3 \8 b; D/ t. d% l
<>debuggingConsole.asp </P>
+ z  s9 o+ h, O: K: k. q- s- K<>&lt;% 7 U* `% Z3 u) @5 _: ?. ?
Class debuggingConsole </P>7 `2 F9 M' x8 ?) r& ]% Q
<>   private dbg_Enabled 8 {( e& c" D; P7 z0 U+ [, F& f$ e  ~
   private dbg_Show
1 L) x1 n# r3 O6 p   private dbg_RequestTime
$ r  b: G2 d0 p3 {   private dbg_FinishTime / X/ E. v+ l' `
   private dbg_Data " q' Y/ h8 z2 W+ m6 Q5 A
   private dbg_DB_Data
6 O$ A( S8 H! B% Y   private dbg_AllVars
/ m8 p4 ]2 S* {$ v3 W   private dbg_Show_default
8 U' L, ?' H% B( U) ?. ]2 t4 G1 g1 h0 o! q   private DivSets(2) 6 G/ F. v; H0 H
   
  z8 Y+ J& L/ |$ h'Construktor =&gt; set the default values
; s  M# c5 z) H( L2 \! nPrivate Sub Class_Initialize()
% ]# V# ], G1 f# Q' p" P: n7 g# s   dbg_RequestTime = Now() ' ^1 }! A; B, B% w' p! [
   dbg_AllVars = false
" o8 Z8 X# Y7 Q  x- V# U0 {" K   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>, O% t4 J( D8 t9 p3 x
<>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>, C+ q  |; G8 O/ F
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;* W2 V% _& Q! R& m; Z
&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>
/ }0 e: A; Y( _+ T<>   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>. [5 m8 f8 Y& r2 n1 P8 T2 N
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
! R4 c, q# N# v( o2 _1 tEnd Sub </P>9 }/ g" E- J2 E  @# c
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
; I8 S5 @1 K  Z1 i" Y# |   dbg_Enabled = bNewValue # S, F1 z* g6 j
End Property </P>, u5 j) U+ h$ \+ i) U; T+ }
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
: C% r$ \" X; D# J* i0 w  W  ?; l4 Q. \   Enabled = dbg_Enabled
! Q. ?/ a/ p8 `4 x. g: r: KEnd Property </P>
- i' S1 P# p3 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
& \1 T. Q& Q) X   dbg_Show = bNewValue * c5 j! k! y3 y- b, o# m
End Property </P>& O  g- R# W+ d! x  {
<>ublic Property Get Show ''[string] Gets the debugging panel.
, @% l+ J0 z7 B4 {5 x   Show = dbg_Show
9 O7 z$ e% U" c6 x* }End Property </P>
, t) W( u" B4 c( [6 f<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 2 T' K/ l! g# n# R4 L( ^8 B# [
   dbg_AllVars = bNewValue ! X1 Q' W% P! P# V  \% K  a
End Property </P>
) B: Y# j  c0 o: L( s1 h7 H<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. : ~6 d) W, U  I
   AllVars = dbg_AllVars
7 e1 w1 B0 z* [* x' L" BEnd Property </P>
0 G, B) r; m4 F9 X<>'*********************************************************** 7 ?. f; F' h- s# n& {1 C9 N9 V
''@SDESCRIPTION: Adds a variable to the debug-informations. % }# z! N' J' A5 x$ o1 E/ s  G
''@PARAM:  - label [string]: Description of the variable ( W, a% d, f' k# T( ^& g, a* _* T
''@PARAM:  - output [variable]: The variable itself % _# k2 I6 ]8 K
'*********************************************************** - u/ ^- o' S% F, a' W
Public Sub Print(label, output) 1 S+ t  j4 w  Z" b7 g
   If dbg_Enabled Then
( C6 ]8 P/ x6 E* y6 |     if err.number &gt; 0 then
5 }4 m9 Z& q, g- M: Q       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
  x: @0 o9 [) C8 F$ g+ ~0 @       err.Clear
0 m# {# Q9 x% z. {) H     else 8 v9 @( U" |, H  T
       uniqueID = ValidLabel(label) 5 w. @$ Z1 v: S/ X: e& W$ }: ^5 m
       response.write uniqueID
/ H8 M. G2 W. c) w5 A+ A9 Z       call dbg_Data.Add(uniqueID, output)
# n4 p# P, ~, U& \. {* i     end if   _! Z3 o% r4 c7 ~4 l' X
   End If ! p; \; K1 Z8 ~9 T6 q1 }4 O6 |
End Sub " g" I9 I# `5 J9 l# b3 ^1 u  B
  
3 w# a0 g/ M* C: Q( u'*********************************************************** : y1 n$ v. I* ~/ M
'* ValidLabel
; V: p1 [- R7 ~1 u1 Z0 T/ y7 j'*********************************************************** 1 n9 ~1 o! k; |% T/ G9 S
Private Function ValidLabel(byval label)
9 S8 `! V; C1 {4 q: [0 D   dim i, lbl " q5 }/ U6 M) c
   i = 0
! W/ z0 b  [& w+ p) A! Q1 a1 U   lbl = label 1 E: @* [$ b; {, r. H
   do ; k" @1 k, @8 a; K6 `: I
   if not dbg_Data.Exists(lbl) then exit do
; \& L2 Y  b# z   i = i + 1 1 D8 G9 j$ n( g# Q  u% P
   lbl = label &amp; "(" &amp; i &amp; ")"
2 \7 W9 c. ]' C( z   loop until i = i ! {1 J) ~: r* y7 Z
  
, Q/ a/ N( c$ `$ W   ValidLabel = lbl " d1 s: v: A- Y$ W% l5 v  y
End Function
( N, i7 T( T* z/ G* P4 i  
4 B, @/ G/ U1 D- |3 k# J$ z$ u'***********************************************************
9 @( d. r  o: u: c/ ^'* PrintCookiesInfo " M+ M3 y( L4 q* A5 G
'***********************************************************
* D8 Q/ c& T/ p' q  l; p" `Private Sub PrintCookiesInfo(byval DivSetNo)
9 u% J+ q$ N3 O+ V3 w$ u$ T8 V   dim tbl, cookie, key, tmp 7 _9 U0 C3 r! ]* |% E
   For Each cookie in Request.Cookies 7 z7 [4 r5 l' \# v* V; S" ~: x4 `) l9 ^
   If Not Request.Cookies(cookie).HasKeys Then # y% y0 X  p2 }/ b1 V
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ ^2 H' U9 L+ i% d   Else
! i+ ^' f/ Q& I" u& n& W6 y1 G     For Each key in Request.Cookies(cookie)
0 {. X7 \0 f& O0 }     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 5 W% E$ r6 ^4 D" O
Cookies(cookie)(key))   
3 m  `6 z$ h, d' }2 L   Next 1 t" M% c4 D% U# r# h; g
   End If
/ n1 v9 ]' s! l+ j1 c/ y% c' U; \   Next </P>
7 T. R; N+ p( {/ Q& l6 K- L. c<>   tbl = MakeTable(tbl) 0 ]% M5 A- w5 `- \
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 6 d5 @! t9 E" o0 l: y% ^1 C  k; d4 N
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 2 N, E! w  n& b& d
   Response.Write replace(tmp,"|", vbcrlf) 7 ^- T( N( k, p4 B$ o
end sub
3 |0 d# f8 {/ L0 i# _: Z  + S% `8 e. c" W6 [3 p9 B
'*********************************************************** 9 O5 J0 ?4 f6 \* V, _: w
'* PrintSummaryInfo
+ e) p5 F" N! Z'***********************************************************
: d' \2 z* n5 {2 _$ S" qPrivate Sub PrintSummaryInfo(byval DivSetNo)
8 T- V, I% F0 P6 ?- @" C$ T   dim tmp, tbl * |! S$ a0 r. Q1 g  {
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ! S1 \2 T' B0 v% z* B8 n8 z
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
9 }1 ]) O2 s1 z  D) W- ^1 M   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
% u5 q% z, s  p   tbl = AddRow(tbl, "Status Code",Response.Status)
' c$ Z2 E3 _$ k9 U0 S, }   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) $ s( c0 Y# t& E  ~6 k
   tbl = MakeTable(tbl)
% T6 j  N: u% ?5 M   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
; @6 k; @9 T' y   Response.Write replace(tmp,"|", vbcrlf)
6 I* e+ C! I( j# Q3 xEnd Sub </P>
+ s4 [* W; k* M" y( @; v<>'***********************************************************
1 |0 v+ a* l4 v. A+ T''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 2 B( q* _% D! d0 U' a+ a( }
''@PARAM:  - oSQLDB [object]: connection-object
, @$ c. u2 G5 E# v; s7 k% j3 R) V'*********************************************************** ; ^7 S! l5 F) N4 @& U! B
Public Sub GrabDatabaseInfo(byval oSQLDB) ; c# j1 ?) {2 J/ h/ o) g
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
' O9 U/ C+ P: s  p& k7 Q   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 3 Z( G7 u0 S2 u" {
   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"))
- ?, [. m% j/ c& y$ w   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
( F' F' G- Q% s& yEnd Sub <>'***********************************************************
' ?. y6 @/ X) q. c" w1 a+ o'* PrintDatabaseInfo
9 k5 Y; H9 C2 y7 y% y" ?2 R& s4 C'***********************************************************
5 d( i; Z. d& _  i- z/ v! D* W3 oPrivate Sub PrintDatabaseInfo(byval DivSetNo)
$ \+ |  {* J* y6 |   dim tbl
! H  ^7 ^# Y+ y7 `% \   tbl = MakeTable(dbg_DB_Data) ( I8 C1 i8 s. M( u
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 x. h; @3 M7 y# O   Response.Write replace(tbl,"|", vbcrlf) 0 e. L: o. V6 l4 L
End Sub </P><>'***********************************************************
- \  R, `# o; V, }+ p. z$ n'* PrintCollection 3 v' c9 R+ D9 t+ x5 o9 L. d! p, @
'*********************************************************** 9 a) ~: B% Y* w
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
  i7 p: \2 S4 p7 F   Dim vItem, tbl, Temp % u0 Q0 L$ I3 Y! n, Y
   For Each vItem In Collection
! K9 u6 D: o# K' W( A. M     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 6 e: X+ p, C2 X" r
       tbl = AddRow(tbl, vItem, "{object}") ) H( C. x2 S, s) C
     elseif isnull(Collection(vItem)) then
" P; v4 ?$ V. R8 ?( b% o$ G* T& Q       tbl = AddRow(tbl, vItem, "{null}")
' E% u0 ?" q. z4 _0 a" U     elseif isarray(Collection(vItem)) then 5 e* p# G+ v+ d+ D5 m
       tbl = AddRow(tbl, vItem, "{array}") 8 ]" k& x+ f; H+ `+ y7 f4 Y3 v
     else ; m- _. i4 C+ i: @
       if dbg_AllVars then ! a/ i/ m$ q6 I$ |9 ^  y, h9 O, u
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 2 ^; o! [+ {& n. @- S
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
- R' z9 z/ y8 {. v$ M       if Collection(vItem) &lt;&gt; "" then
( P9 h% l, s+ ?6 x1 m       tbl = AddRow(tbl, vItem, server.HTML
. g6 F/ j7 x2 |2 L6 kEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ( T" `8 m* [  v+ o+ B; s
       else
, `/ _- |: w! v7 J) A       tbl = AddRow(tbl, vItem, "...") * m' m) A) V0 e3 r9 F2 q6 L- Y1 f: M
       end if - M& y+ w4 M) i9 V% z
     end if
: t/ A7 e$ Y. H& |/ w" i' K9 s   end if % d1 ~7 k  d% |9 V  T5 s6 m
   Next
1 q7 ]/ d" I) @# g; i2 W   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo - F: C0 c" [9 w. C4 F& g
   tbl = MakeTable(tbl) / Q! n# c% J1 }
   if Collection.count &lt;= 0 then DivSetNo =2 ) J: C7 ?9 z. g: W2 |# u- _3 G0 @
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) # n  {6 D! C0 n' ~3 ~8 m
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ P5 v. D! d' n% v8 S0 B7 b     Response.Write replace(tbl,"|", vbcrlf) ! Z7 Y8 Q$ |) W8 h* K( H
End Sub
/ @& o& A8 R4 n$ L: z1 a% \  
) v) F6 q5 P$ g0 X'*********************************************************** / W( x$ t5 a7 a. U5 @% U
'* AddRow ' H0 f1 Z+ L4 O' Y
'*********************************************************** # z; b: {# I& E4 Q% F1 D
Private Function AddRow(byval t, byval var, byval val) 4 H, ^: h' ]' E& _; m3 B
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" # q  o8 w% d) o! i3 E  ~
   AddRow = t
2 z; S6 L) g9 E6 e1 v6 s; @. ZEnd Function </P><>'*********************************************************** % A% w9 s, U9 W0 Y2 `
'* MakeTable
9 H0 g+ w  S8 @7 B'***********************************************************
, y* ]$ E4 V- y( s/ T9 e0 lPrivate Function MakeTable(byval tdata) 3 ?( A5 c! q* f( G5 b
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ( P6 a% v9 r+ Z  u& t
   MakeTable = tdata
7 j2 k( k8 m( yEnd Function </P><>'*********************************************************** ! [' \2 C2 H6 {+ ^1 q/ G
''@SDESCRIPTION: Draws the Debug-panel
) h# X; P3 j- |'***********************************************************
1 N* @5 m* f2 f! sPublic Sub draw()
- p% p: t! D" M- s) X   If dbg_Enabled Then
9 Y% Z6 p. e% S( j, [; F     dbg_FinishTime = Now()
1 ]6 f2 _1 H7 [( H/ V( }  # w9 b. ^) o% _2 n6 G8 y1 Q& x6 v
   Dim DivSet, x
8 j: @1 u4 e1 e4 S   DivSet = split(dbg_Show_default,",")
. k2 L, r4 u2 k% F     dbg_Show = split(dbg_Show,",") " a0 ^) c2 p' k8 e" h# S4 P
  8 f* S3 J! J+ [, s/ A& z# L: |# J' p
   For x = 0 to ubound(dbg_Show) ! C3 \) K& e; ]9 Z6 P7 x# [
     divSet(x) = dbg_Show(x)
& z7 r8 F5 @" w2 n8 Y3 P7 j( }   Next . J* \) n7 _2 K: h
  % ^/ x* Z! B7 P3 c
   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 A, q! }- R+ R# s9 |   Call PrintSummaryInfo(divSet(0)) + j+ D  K* u/ U- m5 Y
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 N8 S; A5 G( G* P9 g9 }
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
! F: S: l1 h5 Q, F    Call PrintCollection("FORM", Request.Form(),divSet(3),"") & ]$ U* I8 r5 C: E' G
    Call PrintCookiesInfo(divSet(4)) 2 M+ U* u+ n2 V- F; v* ]9 K
    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)) 7 C4 J: c& L8 b3 Q: i, x
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
6 k" L. Q  v( ^. ]* {0 W7 R7 D6 S4 A    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' @: j5 N- C8 {  \# ^5 g" A    Call PrintDatabaseInfo(divSet(8)) ! X; g+ A+ i/ N2 E6 ~+ w
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( |! Z" ^' {3 S; }0 a    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 6 b7 r! ]; W- G7 j- J1 P- F4 m- a- q/ A
    Response.Write "&lt;/Table&gt;"
2 d. e. u* H2 E4 L5 v   End If $ h1 M/ A- b7 S7 A: ~8 z
End Sub </P><>'Destructor
! N9 s: W7 _0 J, M6 G1 |Private Sub Class_Terminate()
/ ]! c# s1 S9 x7 E, q   Set dbg_Data = Nothing 3 V: N! h' w7 |
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>, W/ ?9 @, _2 F" `8 t* P1 q8 h
CLASS debuggingConsole & c; h6 x# H+ r) B/ U4 ~+ Z
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
* V' N* C% p9 X&amp;n
2 V8 N, [/ g: `# Z! E- r# Ybsp; / O0 x+ N5 u3 L2 W
Property Get Enabled===[bool] Gets the "enabled" value 3 Q4 A2 Z  d- {3 v  I8 v! g
  
  o0 _0 c$ S% L' z. Q4 l* bProperty 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 # z0 ?! s, X4 R9 L/ [
  
4 N/ A( C7 `' p7 M: _Property Get Show===[string] Gets the debugging panel. $ y" x* W/ s/ o0 T
  0 Y& Y; s/ k+ u$ @7 K
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><>-------------------------------------------------------------------------------- # a, b  [( e! M1 x. B
Public Methods </P><>public sub===Print (label, output)
7 X. d6 C+ D, `8 P8 b% k   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
4 B) w8 [) t, P# d6 F7 Y   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ; e7 ]3 H7 ^: [8 [. F
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
0 i$ C3 c! h2 f! g9 |Methods Detail
, z0 l5 t' O: O9 M# b  {1 B  " M# ^9 k& Z: H) h
public sub===Print (label, output) ( I3 j7 ^. d. o$ u4 E& g4 ~
Parameters:  8 B4 w3 t/ e( q! d3 C$ |' r7 w
   - label [string]: Description of the variable
6 v( n0 k: _0 J  ~2 P* h+ y) R( L   - output [variable]: The variable itself ( e  {* \, ]( A. D) A) B
  3 \3 s7 s4 B: D! W9 v
public sub===GrabDatabaseInfo (byval oSQLDB)
" B% y- j; `0 t0 nParameters:  
: n; L+ S! [1 C. h+ \. f7 u2 m   - 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-3 23:13 , Processed in 0.710490 second(s), 57 queries .

回顶部