QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>' L3 f/ l2 ?$ F! h! U
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! & V! q/ R; Z% N, g
使用方法很简单:
) l/ S$ E& f7 J2 |0 {* C& O* Ntest.asp </P># J/ b* \  p4 h( V" M6 {! x  y' i
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ( i8 b& _( m9 T! b4 H
&lt;%
% k* g9 |9 y8 Voutput="XXXX"
8 q0 |7 x2 Q) _, H- HSet debugstr = New debuggingConsole ; ]8 q, m% p# }% `) a- l8 t3 T
debugstr.Enabled = true ' L. \$ O" L5 M6 I# o
   debugstr.Print "参数output的值", output
' W/ I  s# ]2 D8 J6 f' r# G( q   '……
% b$ U$ t- N3 Y1 k   debugstr.draw 1 s  l. O9 [# U3 i$ e. E4 C
Set debugstr = Nothing
$ J8 |' [4 Y: ~5 ~! [# @%&gt; </P>
: C1 k0 K3 E# r) W/ ]# X5 K7 T<>=================================================== </P>
0 X' O( l0 A' h" }0 o1 e<>debuggingConsole.asp </P>! b" h1 |* T+ P5 |; _4 O
<>&lt;%
3 K5 G! p" j# e% U0 r7 {8 QClass debuggingConsole </P>
1 n/ q/ F, `. g8 U- N<>   private dbg_Enabled ' w: ^' b, v$ m- o; `0 z, j8 D4 `
   private dbg_Show
& i- w1 s  O0 R: k5 {" ?6 X   private dbg_RequestTime
# B8 i  Y4 ]8 R2 ]5 y  \# i   private dbg_FinishTime : h) u' m9 [3 |; H$ ?- w* |
   private dbg_Data
- t6 X1 T6 h5 r' q5 N5 t  l   private dbg_DB_Data
2 K" [1 l; ~/ u0 _3 E7 t8 H" @   private dbg_AllVars
2 g  |5 I) T( |3 v1 b2 K4 C   private dbg_Show_default / S0 Y# b! K$ T" p) ]2 `  w1 E7 w
   private DivSets(2)
' M; k' ]5 l+ f1 r   3 P8 }3 r' j6 [% B$ ^5 B
'Construktor =&gt; set the default values ) C7 Z" r7 Y3 H1 h7 s
Private Sub Class_Initialize() % N3 C2 W7 l! a) C
   dbg_RequestTime = Now()
/ ~2 Q; d& b# u1 R, A   dbg_AllVars = false
) ^2 x2 K$ S5 \: m, Q: Q   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
6 l, x! B+ l! Z+ Y8 \<>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>
6 U) O" h2 _9 m& n" r% Q<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
( f7 X" u& r3 P  ]8 r&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># [( g& @* J! @+ }: d" x
<>   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>
0 M9 Z8 v# b. A" H4 K<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
% o# \: ^4 A0 Y3 z: LEnd Sub </P>- D: Y# P5 k6 I- ~) n
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 7 h1 T2 e- G0 @
   dbg_Enabled = bNewValue - i* G/ o% D6 g! x" j& s
End Property </P>  r0 G, p% p- \, p8 [
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
8 ?, [6 E% d; d" Z. v   Enabled = dbg_Enabled
/ k! _' T/ ?, p3 lEnd Property </P>
; r0 R: \6 r, ]5 z. U* i: J4 R. i<>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 # K3 u2 ]$ y- m
   dbg_Show = bNewValue
. ]  `+ L2 j* e8 ~( `! MEnd Property </P>" x/ \! p! F5 Y/ }& C
<>ublic Property Get Show ''[string] Gets the debugging panel. ) ]7 X3 Y9 J! O+ z7 |
   Show = dbg_Show
+ `5 j/ h. Z3 tEnd Property </P>
3 K0 F1 ]# U" i2 K- \<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 1 P% ~5 V% b) ]7 E
   dbg_AllVars = bNewValue
4 |  C  d& Z+ h0 `End Property </P>* U5 X0 E1 c9 O7 v
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
. ]5 C$ w4 x5 e+ U/ k- t   AllVars = dbg_AllVars
# S" l7 R4 x5 ~* `: {End Property </P>
( `# X" G# H; d5 K: ~1 L<>'***********************************************************
9 S3 `9 m, K& C5 c8 v, F5 Z''@SDESCRIPTION: Adds a variable to the debug-informations.
$ ]( B1 W- R: }, ~. P''@PARAM:  - label [string]: Description of the variable 0 H5 G- _/ `- s; Q5 j$ j: ?( ?. L
''@PARAM:  - output [variable]: The variable itself
8 H: E1 i! q" g2 |% e/ p- E) X'***********************************************************
% a* \4 `& g0 Q- Q- V9 zPublic Sub Print(label, output)
4 U6 P( }$ t0 A$ d% ]9 v   If dbg_Enabled Then
( q7 E) H- u* E, [* V  y3 N     if err.number &gt; 0 then
) t, `' m  x5 X# _3 e       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
9 D$ ~) ~0 _+ V# d  u       err.Clear . y; {$ o  D  e$ w* x
     else
1 }. z" m! A( k/ Y       uniqueID = ValidLabel(label) : R" F$ y2 k* G" `
       response.write uniqueID ' ?# j% |8 b  b! {8 t0 s: ^
       call dbg_Data.Add(uniqueID, output) 7 ^& c; O4 F6 B! }
     end if $ Q6 {0 O# z/ o9 Y# {
   End If
% Q1 V! ~2 w3 s" I9 P; I( g7 oEnd Sub
0 W/ \) S. O3 M8 J  
3 L. B8 w$ {; W0 j1 O  X& R/ ~5 ]'***********************************************************
, Y$ H  k( x+ D'* ValidLabel
# Y2 K  |7 x* A) s) o' d'*********************************************************** ( }/ x6 S  r; D  V2 K2 Q
Private Function ValidLabel(byval label) * U$ e2 r4 g& X, Y0 m
   dim i, lbl * _: D0 t2 I; d! B$ B! c0 @( Q
   i = 0
- v9 V! T/ \9 Z+ n   lbl = label
" c8 q+ a& p- a, H   do , i2 P% C% d3 l4 G4 _1 o
   if not dbg_Data.Exists(lbl) then exit do
% X% T! v8 ~& F) z2 n   i = i + 1
& v0 |, E% p0 O$ E/ A5 D$ T   lbl = label &amp; "(" &amp; i &amp; ")"
2 a7 Z! z! @$ ~& s5 f6 x   loop until i = i   \% V8 `# f% x  X9 @1 v
  
' A6 Q1 R$ o0 h7 V8 m8 V   ValidLabel = lbl 6 ^1 q& x6 U1 C4 O: X& J" g
End Function : j$ ], \! K4 n9 ?5 v& s6 R
  ( Z- {/ \+ |* D5 t
'*********************************************************** 1 T7 K( ^8 f) A+ h$ y' |  b
'* PrintCookiesInfo
" C) ]1 }7 s0 o( O'***********************************************************
& L4 ^' W7 o! _1 Q* g' kPrivate Sub PrintCookiesInfo(byval DivSetNo)
  Y1 Q, z9 E$ y) J, F8 X   dim tbl, cookie, key, tmp 6 W  g# U5 H( x: n/ b3 j
   For Each cookie in Request.Cookies " {$ N; w2 ]( p2 m
   If Not Request.Cookies(cookie).HasKeys Then
+ p3 g$ ]5 n- x/ a; C9 V: M     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   , c3 D% L) i5 O8 S2 P- P
   Else
8 ~- D: A5 F0 a5 n) J     For Each key in Request.Cookies(cookie)
$ F* W! j1 l6 {/ i2 w' J4 E     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. . o$ @9 I4 l# s
Cookies(cookie)(key))   , O* r* n5 S- a% _" f6 v
   Next * b4 R/ u' ^& X9 U- F8 b. ^
   End If
& R2 ^6 q6 q" S) e, l   Next </P>
) Z$ V+ C9 p  R  I' V$ _  i! c<>   tbl = MakeTable(tbl) , n$ E2 o" P+ H9 f7 q
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 4 e& `3 u& M8 ]  X- ^& ~
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
3 |/ K; e$ j3 b2 C/ _( O! y   Response.Write replace(tmp,"|", vbcrlf) ) R: z" c  K$ B7 w( {
end sub   J) I; D+ W, x' Y
  
- [  q* _; n1 P7 ^& I& \, ]'*********************************************************** 1 w( M9 {. ^6 U! u* {1 W" K' A, e
'* PrintSummaryInfo
2 u$ u7 U/ t7 A/ _3 ?'*********************************************************** 5 G$ l/ k  |6 |3 S
Private Sub PrintSummaryInfo(byval DivSetNo) ( A. e4 |, @2 i, N6 O% I7 y0 @
   dim tmp, tbl
1 L0 x# z# d% m& C% ]   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ! U! B$ T: }1 ?7 s  G4 q! t  O7 G" _
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ( h+ K3 n# A* }1 f
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) " u' U$ g" u* r  ~1 I/ {# L$ J
   tbl = AddRow(tbl, "Status Code",Response.Status) 4 t, Z% w8 J6 G2 R  ]
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
; N! Z+ N; v0 r   tbl = MakeTable(tbl) 8 A& _  a4 N3 ?8 \
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 8 ]" g  o# D5 s  D# {( e6 X6 V
   Response.Write replace(tmp,"|", vbcrlf)
- Y8 b( U4 M6 U3 XEnd Sub </P>
! _5 l( F9 z; t+ L& |<>'*********************************************************** 0 f6 d3 @3 l3 F9 J% b& ?% I
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 4 I+ e0 d/ @2 K% T  E' [/ n
''@PARAM:  - oSQLDB [object]: connection-object 9 I- n5 q7 C4 p! P4 a- Y
'*********************************************************** $ \; Y5 P. B0 J
Public Sub GrabDatabaseInfo(byval oSQLDB) ! f; H; H7 b8 E/ B  \
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
' m+ D/ ?# Y' m+ O" J   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 9 k- y6 |# R: {$ U2 s
   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")) ' @2 p4 A2 B8 p3 Y
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) # J) S9 V. j2 r7 S5 k
End Sub <>'***********************************************************
2 y/ }* v' x2 h'* PrintDatabaseInfo
+ `4 J5 L2 ~; R/ ^9 o'***********************************************************
$ C0 c9 s3 T, YPrivate Sub PrintDatabaseInfo(byval DivSetNo)
' e" Q2 j! Z5 o4 Y+ M# \   dim tbl $ h9 {. w" b" r% A( M
   tbl = MakeTable(dbg_DB_Data)
2 `& g7 O4 q! H8 V& Q: z4 x' P* q  p   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# G1 `& K: r' J  i   Response.Write replace(tbl,"|", vbcrlf) % X; n9 o8 W* C( Y% K6 |
End Sub </P><>'***********************************************************
- N4 o" a' W- R# v* p% b'* PrintCollection , a0 ?/ G. C& X) X2 ~' [
'***********************************************************
. ^- n& r! z* b+ f3 YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 g) s9 K" j2 ^  I, i   Dim vItem, tbl, Temp % ^" ^1 J: o; a% l- }& K; e
   For Each vItem In Collection
( S( x+ l# ~  D     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then / b* B9 C. B1 B
       tbl = AddRow(tbl, vItem, "{object}") + S2 I$ t7 W" s4 p( C! j
     elseif isnull(Collection(vItem)) then
' \# j" v9 B6 d. |& h( l4 j5 h' G       tbl = AddRow(tbl, vItem, "{null}") ( X( _( h6 z# p" B  r8 V
     elseif isarray(Collection(vItem)) then
  K6 B% Y) {5 |8 c7 s       tbl = AddRow(tbl, vItem, "{array}")
) G+ I% {; u. D$ S+ Y5 b     else
' [  g+ f: N! U6 D8 N7 u5 H4 i; w       if dbg_AllVars then
. T: e2 M* y- r$ T& R% I, \4 U* ?4 X       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
1 I$ S7 ~" i0 p% k& X+ x, t     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
- c& R' K& k9 q, e       if Collection(vItem) &lt;&gt; "" then
0 s3 G: T# a* m# ^2 ]       tbl = AddRow(tbl, vItem, server.HTML
+ L9 y- h$ O) |! ^& h6 VEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") + c& W4 g& W" x5 c4 I. _4 H
       else * x: \& ?' I  U8 S  o; ]
       tbl = AddRow(tbl, vItem, "...")
; ~" ~  O' Y: F- K. |. H# b# f       end if ' [/ `( w1 R0 }. O8 \
     end if
2 U  ?, k' `$ C   end if
. h9 W1 r3 K3 S   Next ' A+ F* t( Q# 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 6 ?4 N* z" H# w6 I' x
   tbl = MakeTable(tbl) : O+ r# H( x0 ~6 I7 a/ p+ |
   if Collection.count &lt;= 0 then DivSetNo =2
& P+ s$ Q1 B' a/ \0 g1 G     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
  c% ]6 W, U1 a4 K( I     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 O! V) ~) U0 o5 I8 B/ a# U+ p6 {
     Response.Write replace(tbl,"|", vbcrlf)
+ T6 t% l2 F5 J+ J# gEnd Sub 0 ^0 s1 {: ~: s1 H6 [! }- _
  * A+ }. H* i# e$ v
'***********************************************************
8 |1 `! l+ k' c; w/ L2 i; \( o'* AddRow 8 E* C8 R/ g2 Q# S2 i6 h2 c: K$ g9 o
'*********************************************************** : J- y2 a+ i5 v* I4 g/ ?
Private Function AddRow(byval t, byval var, byval val)
8 h  @+ Z' C! z9 F   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" & b( T7 s! Y& a0 F( X: f& m7 b
   AddRow = t , J' E" `' ^* _
End Function </P><>'***********************************************************
  ^: W5 W( Q; Y. }1 V% @0 z'* MakeTable
' M2 A* X, P/ \3 k'***********************************************************
0 S: |0 h! n6 ~: ~+ gPrivate Function MakeTable(byval tdata)
7 k8 p- N* |: d' K5 S; R   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" $ v' v4 a  B8 g  n, p
   MakeTable = tdata % d1 ]' G. V  a2 \0 ^6 h
End Function </P><>'***********************************************************
6 i+ h' z8 m$ i5 H3 N% z''@SDESCRIPTION: Draws the Debug-panel
" y$ n7 s0 K( b4 V- Z2 z'***********************************************************
$ u. U% _0 z! r* f" wPublic Sub draw()
8 H1 w; y4 @  ~   If dbg_Enabled Then - s( L- }' o& d2 Z( R
     dbg_FinishTime = Now() 9 h2 D' d: K$ G9 y4 w4 P
  5 f, `7 l2 Y2 t
   Dim DivSet, x
5 o! j; X0 @# t; g   DivSet = split(dbg_Show_default,",")
+ Q' A0 t$ ^! s# w6 B& U; E     dbg_Show = split(dbg_Show,",") 1 E, j' y1 q9 E: t
  
# L' K6 _3 a- z2 ]8 Z# e   For x = 0 to ubound(dbg_Show) 2 c- W9 a* [& B9 r8 J/ I
     divSet(x) = dbg_Show(x) ; a2 m( q" h. j# s  @* u/ ?, A
   Next   x# A# r: Z- @4 ?$ I+ A
  
- m" P( j% @) z( F: H   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;"
3 h( z, d5 U: c( n   Call PrintSummaryInfo(divSet(0))
4 ~8 A; z# v# ?  ]  A. x7 t& k! h3 L     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 z- L% d* i, V$ f5 h
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
( G5 u) [4 y+ J' @" ]1 c" k    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 |0 U! s- {# l5 Q% ]  Q    Call PrintCookiesInfo(divSet(4)) * N7 h- N: d* c
    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))   P+ R3 [1 r% J/ m- G8 D9 t* O
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
5 N( s* {8 S8 i) _; j/ ]    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
* z" U  f3 `; s/ C9 e& s    Call PrintDatabaseInfo(divSet(8)) ! P" x3 y6 |! |
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ ]" ~, M( m5 S1 n6 i
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) A' ~* z& U9 B" p5 X8 T( @6 S    Response.Write "&lt;/Table&gt;"
# C4 B6 H8 x1 M8 U6 }8 Z3 A   End If   K7 m' h$ N3 f6 g$ l% v
End Sub </P><>'Destructor # f9 S( J! w7 t7 a4 d
Private Sub Class_Terminate()
8 G2 O) r4 W; v! J   Set dbg_Data = Nothing
7 D9 g0 ]2 X# q  Z! D7 vEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
3 b0 I6 _9 \0 z  O& d- Y4 |3 x. kCLASS debuggingConsole , N& d8 n$ _9 W( K, X
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 |9 {  }' ?! \/ }* ^5 [8 ~% d! v&amp;n
( L" S$ W6 ], N2 Z0 ?bsp;
$ R  k5 ]) v0 W5 xProperty Get Enabled===[bool] Gets the "enabled" value
  ]/ M) S9 [, u# ]& |5 I  
* s  `$ C3 R6 I4 w0 V) m+ d8 pProperty 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
6 A, u# K+ C+ ]* b* }  
- T* z7 P0 ~  QProperty Get Show===[string] Gets the debugging panel.
1 A( N5 s1 F& h% o( U2 H- N  3 x: n/ k1 _1 {- }# G* `0 m: J; 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><>-------------------------------------------------------------------------------- 6 B+ W' T0 G$ }  n  f5 p
Public Methods </P><>public sub===Print (label, output) * @2 a' Q; }3 }7 B/ j: o1 |- Z
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
, I% a4 n7 R  {: \9 }5 W  [4 m$ b   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
6 P3 A' f1 D! l5 G* j. Z   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
6 p. h, o6 M1 U/ |7 I  C2 B% vMethods Detail
& d7 S% w$ Z- Y9 Y  
% n) m5 F0 `2 R6 Y6 O6 lpublic sub===Print (label, output) % n/ S8 ~3 P& V1 e* b) g- i1 v
Parameters:  ' j2 x  D1 u6 V/ v4 {4 f
   - label [string]: Description of the variable ' b: i1 s5 {3 u8 g
   - output [variable]: The variable itself
3 W8 l( ]- ?% G0 [  0 P, I! X& Q. o+ B, B; E' g( y
public sub===GrabDatabaseInfo (byval oSQLDB)
3 R' g" E- p5 f/ v* {7 ?6 K0 o  B# ZParameters:  * i+ |& ~8 k0 l! x, }0 G3 C
   - 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-12-14 04:02 , Processed in 0.362003 second(s), 56 queries .

回顶部