QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
5 l8 y' L# r8 H" O  k( b2 g<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
+ z- c( v( b7 @使用方法很简单: & o: [/ H+ V# J1 l
test.asp </P>
& l3 ?6 N: b/ ?* m2 b4 y<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
7 K+ v6 b0 G9 y9 }$ Z&lt;% $ D8 E" I6 f" a4 ~
output="XXXX" ( d( H! u3 ~5 G" P' v: O
Set debugstr = New debuggingConsole
7 ^0 u! l( ~  ^" G: P2 G4 x; T9 b* Jdebugstr.Enabled = true
+ x- _" X9 K2 G   debugstr.Print "参数output的值", output + ^# \, }0 C6 V# f% F
   '……
$ R8 u& e; j) t$ ]   debugstr.draw : X/ S+ J- I5 [6 D/ Q* W9 G8 n: L
Set debugstr = Nothing
' V- u+ L7 d6 e' P; j' S' _  b8 |%&gt; </P>
5 |; n) W3 W# @) Q% a! x<>=================================================== </P>
) J1 W0 R4 {5 E8 d7 T4 D3 L<>debuggingConsole.asp </P>2 H$ V1 {- F4 J) Q
<>&lt;%
% y1 f$ d3 }( x( TClass debuggingConsole </P>: X. P0 M+ N8 ]8 X9 x5 _3 }& ^) W
<>   private dbg_Enabled
' g' o& o% z# x  ]0 D/ d3 @   private dbg_Show $ U9 _5 {) N( c
   private dbg_RequestTime + B8 k  b- {3 n2 _. o& p! g0 t, `- j
   private dbg_FinishTime ; {7 j9 p; `7 Y$ l- b* T3 a/ K
   private dbg_Data ) {  J$ @* ?# S- N; q& D
   private dbg_DB_Data
! h3 y8 s! I6 s# @8 L8 z   private dbg_AllVars % S7 G; E/ O- y- M$ j& L5 K
   private dbg_Show_default 5 }* i2 H, m) D) _5 I4 b
   private DivSets(2)
# e! C0 L- x; i     N! p1 N/ q& K9 p2 H/ T7 a+ k
'Construktor =&gt; set the default values $ t; y" b% _$ P$ K* A: H( I, e- P
Private Sub Class_Initialize()
& m# F0 _& u* s# m4 G0 P* Z  I   dbg_RequestTime = Now() , J. ^" e, S# {
   dbg_AllVars = false
- s+ Y! f5 F# g/ }  M, W2 n   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
  M6 H& Q6 \, ]( H/ u' ~- 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>
3 q; ^1 G3 F2 R/ {/ C5 }<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
* f3 \9 \' ]0 a& u. U  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>+ Y& w8 x9 X  s; C1 A% z
<>   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># a! Q5 ?) W' T7 I1 v7 G
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ; e  x" V0 F) g3 p
End Sub </P>
$ V* W  Q' D. ~- @; V% y$ j% ^<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false   a( L" s( ], {* h! L+ L. G1 C. e
   dbg_Enabled = bNewValue 7 h  Y. ?( b4 D) g0 q0 F
End Property </P>! k* _% |) a* s5 U; v$ t
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value # M7 l' E- d& P! X
   Enabled = dbg_Enabled
4 f% v  f3 U- N: s8 HEnd Property </P>( W1 X# G  `$ `+ w7 j7 o: e# H
<>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
  p% Z- n( [* H2 U+ u: q. ]) q) [   dbg_Show = bNewValue
+ _8 u, L- X1 |5 `5 OEnd Property </P>
- I, ^" p% J7 m: F<>ublic Property Get Show ''[string] Gets the debugging panel.
- _( m, r. X5 Q4 V' ?; D   Show = dbg_Show
! d( S7 k- n/ p! ]+ nEnd Property </P>$ V: |3 x2 G4 j6 q' X" v
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false - l3 o+ f/ m4 p4 A5 V. c3 l
   dbg_AllVars = bNewValue % |1 D) N" U; o
End Property </P>
9 Z5 s' X& D) s- u0 v<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( Y. _% p) J1 M" Q$ M; o& c+ z
   AllVars = dbg_AllVars 8 h7 }' q2 X, }, q' {' ^% U" ~/ O
End Property </P>
* N' ]( s$ w7 ^. S<>'***********************************************************
0 h& X: O) o3 m  J& _, L7 s; t: L''@SDESCRIPTION: Adds a variable to the debug-informations.
* O* `' i* ?/ \2 U4 r4 ?6 T''@PARAM:  - label [string]: Description of the variable
1 C9 _9 c- X! c. F$ ]''@PARAM:  - output [variable]: The variable itself
5 M$ ?, b' n6 O'***********************************************************
: @! J  }$ e: o/ gPublic Sub Print(label, output)
' E7 R5 y% }0 N- M  ~; Z# `; P" o; g   If dbg_Enabled Then
! `! \' }* G" ]0 p- [& {. ?2 I, a: s     if err.number &gt; 0 then
) j. A2 H0 p! m. n) l. A% Z( w       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 4 I6 ?  z( s, Z9 D( t3 i5 \' ~
       err.Clear
# z( `! u  \, s3 r     else
# Q) X0 U8 I" Z0 {       uniqueID = ValidLabel(label)
* _+ \2 O( W2 y       response.write uniqueID
/ i; D" c. ~% s* P) W       call dbg_Data.Add(uniqueID, output)
' I7 V" O* g0 u/ s7 A     end if
+ r: |: p9 n! W5 X   End If 8 f. l4 I' v. z; a, i
End Sub ( _5 r0 ~* G! \* a' R" z, n
  
& F2 K2 g8 r8 o6 Y( @' R'*********************************************************** $ i+ u* ~7 s- c$ ]7 |" V
'* ValidLabel
6 {4 L- E# K1 D# t. q' @'***********************************************************
& o3 A" {- {+ U& S& i  m6 @Private Function ValidLabel(byval label)
. D* Q& x$ B9 u" m+ O   dim i, lbl
, ^' G- S! U3 W; m9 `/ p   i = 0
- d% g, H9 n3 v6 T- S   lbl = label ' z! v# u0 q. ?; w8 ?6 \1 s2 U+ i) M
   do + I$ \: P0 l6 V2 j+ h( h
   if not dbg_Data.Exists(lbl) then exit do , w6 ~! P) V5 A" X5 ~3 c, x
   i = i + 1 2 n  S' \1 p# H$ D- a# C. Z
   lbl = label &amp; "(" &amp; i &amp; ")"
" ^8 ?3 z/ y5 }0 L8 s   loop until i = i
) b6 ~6 i, W8 {; R  
. C2 k! _- V: U; z* C   ValidLabel = lbl
; j, x0 J& t9 i+ PEnd Function   X: _2 S+ u; w4 A8 I
  ; i  s1 G( e$ V" {- ~6 d
'*********************************************************** : d/ y- ?$ \$ s2 f- U
'* PrintCookiesInfo
+ o; |: Z4 X& V' P# g'*********************************************************** 4 @- y+ s3 J/ H. }3 b8 v
Private Sub PrintCookiesInfo(byval DivSetNo) / @/ |" W* \/ w, {
   dim tbl, cookie, key, tmp % V/ m  q+ e% e$ \
   For Each cookie in Request.Cookies
( p1 M( @- \: I+ x2 F   If Not Request.Cookies(cookie).HasKeys Then
3 n; U: D( [0 `3 P0 k) U     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
) t! F1 m# [5 k5 r   Else
  }3 o2 y9 W3 \4 T' }2 y! b4 J7 ]8 D     For Each key in Request.Cookies(cookie)
, y5 g: O, H* O+ {     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 9 c3 o/ n& K2 J8 v
Cookies(cookie)(key))   ; `. q3 r5 V2 V
   Next
; K6 A# o+ x9 N   End If
  O4 p* l# u, u9 G& X. s$ ?4 `" K   Next </P>6 E0 ~! z# o6 \! U& u) p3 x
<>   tbl = MakeTable(tbl) + r9 ^8 J$ ?, D. b5 l/ A
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
. d( C" |2 E# w! B+ g: Q   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) . y! Q" M1 |# y3 r7 M
   Response.Write replace(tmp,"|", vbcrlf) - m0 o. c' v) }9 x5 N
end sub % H+ p" S5 H2 \: n# r
  
+ u  c( B% p4 E  b- v& r8 I. f'***********************************************************
# ?( W" a6 G* J% A# \'* PrintSummaryInfo ! l2 E! r9 w2 k
'***********************************************************
3 N" h( v" B2 B5 {  D" UPrivate Sub PrintSummaryInfo(byval DivSetNo) : `# l5 j0 k+ O3 |! _. T
   dim tmp, tbl
6 |$ H5 L* e" t/ e/ N   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
7 g1 K7 B' [# W   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
; o! w3 G0 P9 M1 b: E9 c   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 3 x0 B! U/ z1 f/ y) n- f2 n& H1 W
   tbl = AddRow(tbl, "Status Code",Response.Status) 8 h4 k- H& U$ a1 h' J
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
3 f6 b0 A% e+ T. w! L8 C  z( I; b   tbl = MakeTable(tbl) & S; l+ {% }+ K" p7 W
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
  L4 M+ |. k* b( V! E2 }" O   Response.Write replace(tmp,"|", vbcrlf) 1 P" V; l+ k. g  T
End Sub </P>' h& _3 {3 b8 S3 W9 o
<>'***********************************************************
% v' e& z6 h, b) r7 g1 D# }  k; S( F''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& ~0 G. a0 w, M5 |2 E0 b! H''@PARAM:  - oSQLDB [object]: connection-object
( C) I# M9 L2 T, f6 d9 w'***********************************************************
$ A6 `! m5 l" C$ |Public Sub GrabDatabaseInfo(byval oSQLDB)
* X, a; ~9 a9 _0 p! E9 q( J  ]- `' v" B& y   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
/ q- Q* n, S9 `3 N   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
8 x$ @. b. F( s; ]5 X# F8 q   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"))
3 h' Q' I  f& X+ m. k; K   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 7 b9 ^: d! ^  g3 c/ P
End Sub <>'*********************************************************** 9 p  l/ `* F2 U' \3 o3 O5 w
'* PrintDatabaseInfo
/ p' q$ d& [" H- J3 U" ['*********************************************************** , I3 _0 Z8 ^/ a  P6 B+ [" e
Private Sub PrintDatabaseInfo(byval DivSetNo) 2 {3 j4 V5 T/ Q9 s4 y* B8 L5 M( i
   dim tbl ; s/ n9 X1 s/ g7 ~9 ]% T" t5 A
   tbl = MakeTable(dbg_DB_Data)
+ T) C# B7 X$ X2 C6 S, o   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ s9 b; A# V3 @6 q+ z( M   Response.Write replace(tbl,"|", vbcrlf) " G$ [% j, m( N# A$ G8 B
End Sub </P><>'*********************************************************** , y5 I6 @& l! d# {, U) _. @
'* PrintCollection 5 I8 [. U! I5 V  _
'***********************************************************
& t/ Q! n8 o8 ?. D: C" VPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 ?5 u/ v9 E- ^: C/ _   Dim vItem, tbl, Temp
5 `2 u: K! p2 s' C8 C& W9 w. U   For Each vItem In Collection
" D5 v* e5 j- d& q# Y     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ' Q& C' m/ {1 G+ |' e
       tbl = AddRow(tbl, vItem, "{object}")
7 B" \* K: f: }6 P$ V1 p  v( C6 f     elseif isnull(Collection(vItem)) then
; L. U) H" b& A- u       tbl = AddRow(tbl, vItem, "{null}") & F, h; S( l% ?
     elseif isarray(Collection(vItem)) then 4 T1 c9 U% k' P" ?) H6 S) ^5 u5 _
       tbl = AddRow(tbl, vItem, "{array}")
. c# O; O/ Y8 c; A) A( }     else ' U2 R( }$ q4 @+ _8 s
       if dbg_AllVars then ) u5 U- ?9 }# r  j1 v
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ( \  F8 s6 y/ V: b- }/ G% o5 ?
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
/ G$ E" J' h0 B' Z$ z. F6 H/ Z       if Collection(vItem) &lt;&gt; "" then
. D+ E  g) r! S9 `/ P       tbl = AddRow(tbl, vItem, server.HTML
( z" k( c* m. hEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
; o& e7 \. j9 \  M* A, ~. Z       else 6 m, k; A+ b, S& M+ [
       tbl = AddRow(tbl, vItem, "...") : x6 ]8 j: H# ?. @; T. L
       end if
( U+ o! F; ^  ]) }. v! D     end if / v" @" ?% N1 f, g: U
   end if
+ h0 Y- p8 `& Y& _   Next : X( @( q: V: a
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo , I0 E! N# d, ?* G
   tbl = MakeTable(tbl)
# T% P& Y9 J3 o) H" M, m+ w/ Z   if Collection.count &lt;= 0 then DivSetNo =2
3 I7 l6 r# W5 v: p( D& @     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 3 ^/ ?* l# P, ?: i
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) * a0 t- Z1 s- K; Q- h+ s
     Response.Write replace(tbl,"|", vbcrlf)
7 k% |) \( ]; \# IEnd Sub ' M/ n, A5 K! P& p1 e
  ' l  K; Y+ B) b, E
'***********************************************************
( a% Q% G5 y5 `( w  l8 P'* AddRow
$ K& e/ D9 k  Y6 y' h: x) [9 f'*********************************************************** & }3 H& t1 }, W" j) D
Private Function AddRow(byval t, byval var, byval val) , A. ~& M7 A. S" S8 x, Q* D% L) e  s
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
: W; e5 j: Q! F9 ^   AddRow = t & e* P3 F- r' |  Q; k
End Function </P><>'*********************************************************** + \) o7 b( k0 }+ a
'* MakeTable
1 k6 Y; [6 {8 X" h. \  F'***********************************************************
' m0 S. Y+ P6 J8 \- T0 d% y: ePrivate Function MakeTable(byval tdata)   c! O  W& b5 \. ]& ^
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
- z  Q/ T' E* u   MakeTable = tdata 8 |5 a5 W3 f2 O: q
End Function </P><>'***********************************************************
& _& q% `2 r) h5 h6 A/ j: w. J1 D5 I''@SDESCRIPTION: Draws the Debug-panel
& B  v/ C  D' i2 V; W/ d1 J# m'*********************************************************** % \2 k7 h3 V( N: c* k1 R" `
Public Sub draw()
4 N/ O: z* n1 i- y/ b$ T5 O   If dbg_Enabled Then
" _8 S" z$ I6 N' k     dbg_FinishTime = Now()
" M5 k+ F& i& @7 G! P  5 z; P. K2 J5 |" i; h- s: i
   Dim DivSet, x : v/ l# D) G5 z. }  X+ |
   DivSet = split(dbg_Show_default,",")
: E! d1 {1 @+ b0 P& t     dbg_Show = split(dbg_Show,",")
- m8 L) {1 I! K( D$ b: ?+ A  
, C% }# {! G  Y9 h- R4 n* ?1 w6 Y3 I   For x = 0 to ubound(dbg_Show) ' @  ?  l* A' a; r5 a
     divSet(x) = dbg_Show(x) $ Q+ d( X2 V8 A/ H
   Next
1 _/ k7 ]7 U9 y" Q6 ~  
5 h0 `) a- D: ]5 G   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;"
, e. G! M1 ~- n& y: h   Call PrintSummaryInfo(divSet(0))
1 J1 n4 g/ k9 h  I9 v- E% j     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( s0 l2 o, j# i0 `
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") & ~7 \2 k$ s, U" P/ H
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") ; Z8 l, c+ W. D. G' {5 Q
    Call PrintCookiesInfo(divSet(4))
  [! A+ R5 L% Y' G  z6 ?) A    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)) ; m, t9 U. l4 t4 a! d0 X
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 2 }, S! B3 V1 a2 l7 u4 U
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 3 L% e2 w) o2 |* J4 l
    Call PrintDatabaseInfo(divSet(8)) * A  |/ p3 ^' r& o
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ z+ y, y" h/ ?
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
- D( a9 k8 Z6 `: U7 ]$ G- p: p    Response.Write "&lt;/Table&gt;" $ n7 N4 V  \% X" S# x! x3 @1 o8 @  }' Q9 I) S
   End If
2 h  P% i) D% W; N; K1 i3 fEnd Sub </P><>'Destructor
0 c5 I( `% H4 B  GPrivate Sub Class_Terminate()
) W' S7 `0 `0 t  A8 M   Set dbg_Data = Nothing
2 {& {; v( J3 V9 A- L2 Y( u9 }& SEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
$ v$ w2 i6 l* L: KCLASS debuggingConsole 0 h! v$ n9 K3 x( V& y6 d
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 m; l: I  ~7 C, `- O2 J
&amp;n6 t, I# ~" y( S
bsp; 2 m" _' ?  X4 G) C. N
Property Get Enabled===[bool] Gets the "enabled" value
  ?# d9 ^7 Z/ r; b* P# K  6 u6 M( {8 m* M8 `
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 , y: x! W. E" o- i3 i$ B  D% S1 F
  
, m- C1 q$ v& UProperty Get Show===[string] Gets the debugging panel.
- y4 v1 o; i% m5 v8 }2 T  % o) I% c+ @8 o0 B
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><>--------------------------------------------------------------------------------
9 R* E+ Q, b* `) MPublic Methods </P><>public sub===Print (label, output)
$ n+ m& z/ M1 b' Q   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
1 E8 j( h) W9 p   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () : C: p6 v9 E+ f8 ?) D
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
! v& C2 G+ H; `0 i9 ?$ i8 ?- tMethods Detail 5 k; a. q; s4 t$ Z/ v& H1 j+ w
  
+ \/ _0 E8 m6 g. I7 S# X/ A) spublic sub===Print (label, output)   H# N6 Q% r2 c, P6 I0 @$ ^5 B
Parameters:  
, F4 a& `& R0 K; Y& u6 l" p) \   - label [string]: Description of the variable / M7 n9 j, d7 t6 E3 ~1 ~' Y0 Q3 U
   - output [variable]: The variable itself + C  ]- `: F" J+ @- n0 H
  
  Z# m$ E  f% `4 F5 M7 {* l, g  jpublic sub===GrabDatabaseInfo (byval oSQLDB) & [; }. y. x6 a3 z# B" K
Parameters:  
; v2 @' }& |: e  a$ n% x' L   - 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-7-18 08:42 , Processed in 0.412005 second(s), 57 queries .

回顶部