QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>! ?; Y  w/ Z6 h3 _
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
* E& b! t& s+ U# i2 y% b' W使用方法很简单:
" r# _% z' u' m& }+ o/ ]: Xtest.asp </P>
6 ?& A  C2 b* `+ e1 Y5 K: U5 Z<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
# e9 x, w2 {; R& s&lt;%
1 @+ ^7 I- s, ^4 y' t$ ?9 Routput="XXXX" / [' n0 Y' y" k5 L/ K
Set debugstr = New debuggingConsole 7 `' d! U# l. r& w# K; |
debugstr.Enabled = true
5 m0 ~& J3 F7 v9 Y0 e) _, @0 r" `   debugstr.Print "参数output的值", output : {% ?( U: n# E% A* W" E
   '…… ' F3 V2 C* y1 D4 F3 y. Y
   debugstr.draw , H; h2 k0 Q$ P/ t& Y; J
Set debugstr = Nothing * P' c9 v- z1 W1 d) @+ S% {
%&gt; </P>+ t, m, K! m! q8 v$ U+ I* B
<>=================================================== </P>
7 E0 ~1 P* ^& \; S<>debuggingConsole.asp </P>9 a& G3 X" k7 Z
<>&lt;% ' \) {5 l: ?+ N" O
Class debuggingConsole </P>" W# L# g: x/ n+ \& M9 T$ O* k/ u" O
<>   private dbg_Enabled 6 L( v" J2 F0 J% c5 O* ?+ \
   private dbg_Show
/ k! q( z4 W! F$ y" B  L9 }   private dbg_RequestTime
. Z  K4 x* L6 [7 z) z) Y+ d   private dbg_FinishTime
# o2 E9 P1 q/ X/ S( @   private dbg_Data
" a! a( E& m2 y) V8 z   private dbg_DB_Data ) P7 }. j  l2 L9 i1 F8 S* l
   private dbg_AllVars
! ~9 k( R& I0 [* O   private dbg_Show_default 4 O2 x4 ^' X" d. d- d/ y; s
   private DivSets(2) 1 V) a( H7 Q3 r
   
% z8 l& v$ q+ p! q5 i'Construktor =&gt; set the default values
: _! T5 M$ }: S0 a$ ^Private Sub Class_Initialize()
0 l3 _- d+ I, d$ _+ c+ F   dbg_RequestTime = Now()
$ i2 e/ d: i, y( z4 f   dbg_AllVars = false
- {! x" ~$ H8 S   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>$ J( |0 K: r8 J) r
<>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 C4 |* C# m7 V- L
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;. U% w! d+ F2 [) _, S4 }  U% i
&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>
* b( o0 [9 M8 _+ [$ `, @  j<>   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>7 j; d) x) l  F4 `' C2 ]
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" * I- V. v1 e8 t3 m
End Sub </P>
9 I  i* V) I9 _: g7 I- ]<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
/ \2 W9 ^0 d4 O+ K2 ?. d( m7 E3 L   dbg_Enabled = bNewValue 8 a8 p/ ]) A; d' H
End Property </P>* O. V" u) x7 y0 t) j
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
" X/ A- z4 t9 K   Enabled = dbg_Enabled 7 n! o/ T; z: S1 n6 B! ~4 z
End Property </P>1 c) `; N, M# ]) _* m' P  q
<>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 + R# n2 \# K  ^# @; L- i/ y
   dbg_Show = bNewValue
% D+ W) A$ Y4 L! A  ~' xEnd Property </P>5 L' {) p9 O& y7 t( [
<>ublic Property Get Show ''[string] Gets the debugging panel. 3 n$ [- \' x& m$ \9 }
   Show = dbg_Show 7 V- G: U% Z3 _8 ^& @
End Property </P>) ~( o0 O$ L+ Z
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
% E5 ?9 u9 x& k& o   dbg_AllVars = bNewValue * R3 i( _& Z( L7 H/ ?0 |# w
End Property </P>
$ e4 ]& q; j# z9 n1 ^<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. & M2 S" E9 W9 X$ K/ f
   AllVars = dbg_AllVars
* r9 ^1 S0 |6 @3 _: D1 F# j- zEnd Property </P>- \5 K. Z2 b8 S0 ?! A
<>'*********************************************************** ' c7 v  `" B# S2 q; B# j
''@SDESCRIPTION: Adds a variable to the debug-informations.
9 D: \( G3 ]8 l2 w# F; Y''@PARAM:  - label [string]: Description of the variable 2 n% ?4 L8 z' F  {; r! g' W& `
''@PARAM:  - output [variable]: The variable itself
$ {( @: c: a2 N  R" h'***********************************************************
3 [  M) D8 T8 IPublic Sub Print(label, output)
# T+ b/ U, z# x1 Q  _  p   If dbg_Enabled Then
* p+ _$ p+ Q3 y, E9 N- O     if err.number &gt; 0 then 3 f" _& z5 g# p; P
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) $ R; V, L1 N  m7 E: p5 V
       err.Clear
* W- P1 l' t7 ]" T     else
4 `  j0 t1 V' ^" {/ o0 X6 ?       uniqueID = ValidLabel(label) ; K9 d8 C; j0 U% e4 v9 I
       response.write uniqueID
5 e- f. _5 G; T. P' ^5 l1 M       call dbg_Data.Add(uniqueID, output)
0 i- \) G* c0 F+ R4 ]& i9 N     end if 3 t( Z9 O8 Z1 R) [) e$ z- i* A
   End If
& `8 U2 ^9 X, j' S$ w: e( rEnd Sub 1 a- }  w* B7 T0 n& i' e
  - T# l5 N1 P# m
'*********************************************************** + Z7 D, I. [; u. ^+ T) n
'* ValidLabel
. y' @# P5 x$ b8 v5 ~+ v+ z'*********************************************************** # i# S, J' I9 b, }
Private Function ValidLabel(byval label) / w6 E& J$ V  v' a2 ~. @+ w7 O
   dim i, lbl
' ?5 O% K' u+ o( `3 l   i = 0 # e. c  E2 c+ h3 A& J& u; ~
   lbl = label
$ s2 Y+ N- [. ?4 X4 I: ~   do
; d( `; G# g+ H& O   if not dbg_Data.Exists(lbl) then exit do . [( V4 b; z! P- O
   i = i + 1
, b" z& M  T0 Q  u   lbl = label &amp; "(" &amp; i &amp; ")"
: ?( E* q* B6 F5 I9 ~: M% }   loop until i = i 2 B# L* y% C. S' L
  . X! {/ {% Z$ z. Y
   ValidLabel = lbl 4 V/ y& y4 A# [
End Function
% g4 c7 N* L0 ^5 Y0 l  
: m# W9 y! X( s' C/ B$ G( v6 i'***********************************************************
5 D6 Y5 {% i' N6 c8 r" n' U'* PrintCookiesInfo
/ \9 F: a: O* T+ {" u" Q8 `$ }! ^'***********************************************************
  v0 A" }: O6 |  Z9 o5 \Private Sub PrintCookiesInfo(byval DivSetNo)
" y0 w6 v% G, {0 w   dim tbl, cookie, key, tmp 7 i* m& ~; ?8 U; D9 g: f- T8 o: I  P( c
   For Each cookie in Request.Cookies
0 x. N& ]+ T% M- T/ o' K   If Not Request.Cookies(cookie).HasKeys Then 1 _3 \: e$ M, m* b% Z% z' a
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   : X7 X9 \& E4 b5 D; B
   Else 6 T& N) m- }, {) I1 x) n
     For Each key in Request.Cookies(cookie) - f  B) A! v  }7 S0 v: c
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
+ E/ O9 O! y. i, b( |+ nCookies(cookie)(key))   
" k1 M* `, O- M4 a$ y* g   Next 7 Q4 Q8 t9 k+ ^
   End If $ j/ W( V1 T- j4 A( U
   Next </P>0 t3 S6 w  n+ K) b% ]% [: d
<>   tbl = MakeTable(tbl)
4 @4 n1 k  S$ O, H0 g8 y9 E   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
- |% i' q7 ]' C7 ?. P   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)   e3 [* r, j/ B. E3 X7 Z1 ~
   Response.Write replace(tmp,"|", vbcrlf) : K2 ~+ [% k0 `& Q& N4 r
end sub - \+ H/ J% T# S
  
& ?1 W7 ?5 b+ G5 w'*********************************************************** 6 \9 f- v- P7 V6 U
'* PrintSummaryInfo ; g3 z# t  w2 `" J/ |9 s$ E3 l8 a9 ~% k
'*********************************************************** 6 {4 B. {7 k5 q6 b- f4 p
Private Sub PrintSummaryInfo(byval DivSetNo) , b5 x. B  [% Z% T" }' D6 T9 ?
   dim tmp, tbl
, U, q( f/ i# d& K/ e/ ]) X   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 5 l7 g3 ^% R$ c5 O! l
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
2 e; v, F3 ]- e- \$ q   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 3 F& ]0 Z& K7 L7 R% e
   tbl = AddRow(tbl, "Status Code",Response.Status) - g2 Y  Z3 @0 y; P0 m
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
  [/ f$ n* {& M2 v7 `   tbl = MakeTable(tbl) / A2 [( d# c, X* y" q9 `1 i- T# ^
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
- x8 ?7 u* C' r   Response.Write replace(tmp,"|", vbcrlf) ( m6 A# ^! m& S, k# |
End Sub </P>
- Z, N4 F2 n7 K+ W: W<>'*********************************************************** ! t( L9 n# \+ Z+ y
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
) J5 c! R- i+ i' u, ]8 A''@PARAM:  - oSQLDB [object]: connection-object
. g5 U' k- a# s# Q  H7 l& O# |'*********************************************************** & X' \; _$ \) s2 P" Q- c; N4 e- i
Public Sub GrabDatabaseInfo(byval oSQLDB)
; `' N. |" i9 a, {   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 1 }% M' L/ D7 F/ K. Q% U* N
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ; A) g; u! g% s9 r0 [
   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"))
) }, n: S3 N! u( _   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ! W/ s6 _5 U$ H" Z7 g, l
End Sub <>'*********************************************************** : P4 {% n1 Y6 E7 I
'* PrintDatabaseInfo
4 h/ [- G2 F' y, o' y$ n$ C3 u  _'*********************************************************** ( u8 O* G! l9 X+ L) N+ {+ s' ]  L% T
Private Sub PrintDatabaseInfo(byval DivSetNo)
9 Y6 v. c/ i# m   dim tbl
/ J6 {& z/ s  _5 H9 X# v: A   tbl = MakeTable(dbg_DB_Data)
( Y  f( f0 O6 v4 v   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
8 I6 w6 J, B: f6 {5 X0 {   Response.Write replace(tbl,"|", vbcrlf)
' D2 `' c& i: ^. K' D. qEnd Sub </P><>'***********************************************************
9 c) Q( N5 c3 I( c0 h'* PrintCollection
& e1 L4 m% M+ M$ M" a'*********************************************************** ' j) J, }9 n& i% R9 F
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) $ a" `( {/ ?# Z( }
   Dim vItem, tbl, Temp
- N$ q) [- `+ t& u8 f$ h& W   For Each vItem In Collection 9 N  W& T) y2 A/ w: _9 d
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 6 F( U; p/ v2 e8 z: W( s7 U8 X
       tbl = AddRow(tbl, vItem, "{object}")
9 w2 m6 e. [0 W8 Z     elseif isnull(Collection(vItem)) then * B5 F2 `5 z- q# }
       tbl = AddRow(tbl, vItem, "{null}")
4 N4 \9 U7 S6 N     elseif isarray(Collection(vItem)) then   A( x% |8 Y$ {% x5 D( l' @. V
       tbl = AddRow(tbl, vItem, "{array}")
! T% E+ i- l- [& j( I     else * F! m8 _) L; i; S3 q
       if dbg_AllVars then , [. v5 N& O$ Q5 ~& c& }; _/ D
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 5 u0 _' r3 O2 `( z$ f6 c
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
8 C5 e, k% K3 z; N       if Collection(vItem) &lt;&gt; "" then # |8 f' b# b6 }/ H+ q. W
       tbl = AddRow(tbl, vItem, server.HTML6 P8 H; N% z" O3 v1 w7 o9 W
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") & Y' b6 _" z6 K
       else
5 d: r' m0 B1 u- w6 N' ]       tbl = AddRow(tbl, vItem, "...")
0 A5 t! |" d. d  {: ], b5 q+ c       end if
' b1 N8 Y# L! g" u0 y     end if & r. e& Z( `. r+ ^2 K
   end if , J' T3 Y3 L8 |/ a
   Next
3 M/ m/ y" i1 V8 \   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
8 B  C7 \5 j, _2 A+ V) h   tbl = MakeTable(tbl) & L  _$ i" b2 e4 x
   if Collection.count &lt;= 0 then DivSetNo =2
5 q6 M6 T( P% o0 e4 i  e5 j  E     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 6 E4 W7 f- ]4 E! g' [6 f; C; a
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) " x' @+ i7 `1 F$ T8 ^, h1 Y
     Response.Write replace(tbl,"|", vbcrlf)
: A# B. R8 I6 a$ CEnd Sub
  p' D( g& K, v7 s) l6 `" B  " f" w% m. L8 ^  T! r" a1 Y
'***********************************************************
/ G8 m9 N  R$ A6 J'* AddRow $ Z5 b: ?# @' z1 z
'***********************************************************
2 z( `+ c' e9 r. APrivate Function AddRow(byval t, byval var, byval val)
- `% j" D1 X8 L   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 5 g" {7 H3 e& v1 j: P& E
   AddRow = t
1 b! v  Y4 @/ H& J, KEnd Function </P><>'*********************************************************** % k# P2 O2 p/ n; `0 B
'* MakeTable
  w% Y! G% I+ C'***********************************************************
- ]/ o6 ~6 A5 {+ HPrivate Function MakeTable(byval tdata)
8 m4 Q6 X/ `% o   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" - D# J  E* S# ]1 \/ H- k9 `+ b
   MakeTable = tdata
( W3 g  g7 Y1 d! H+ q- ]# @+ XEnd Function </P><>'***********************************************************   C0 I) |5 b6 c0 x: k
''@SDESCRIPTION: Draws the Debug-panel
4 m3 H/ w$ P7 Z4 E7 o'*********************************************************** ; H9 m# |/ @% F$ G- H: |" x, `
Public Sub draw() 9 Z+ B5 G3 n6 G9 z9 e
   If dbg_Enabled Then 3 J$ _! W; i" I; a* R. ^' w
     dbg_FinishTime = Now()
2 h5 b1 a7 `, o6 F0 x* Z  
$ J; q2 d9 ^3 ]$ n6 S8 Q% P   Dim DivSet, x
: h1 E  y2 g  C7 c   DivSet = split(dbg_Show_default,",")
& s; a: B- U0 s     dbg_Show = split(dbg_Show,",") 7 s, {# d9 Y3 \
  
+ J! w4 Q0 p! ?$ U   For x = 0 to ubound(dbg_Show) * a) d- G, X3 T8 ]. L: K
     divSet(x) = dbg_Show(x) 7 c0 A5 D$ B0 \1 U8 {7 n
   Next
- c& X1 f6 c1 S) `  
( W& L0 K1 ?. z1 U" {   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;" * d% d0 P) x# T. V+ U4 P
   Call PrintSummaryInfo(divSet(0))
1 D0 S8 O- ^' k/ w3 _- z     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") " f  ?6 n- d- }# }* H9 X& V
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( E4 ^1 e; ~) B$ d5 Z2 m0 J) I' `
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
  Y" ?% R# n% w    Call PrintCookiesInfo(divSet(4))
9 X9 t. c3 U8 G. n- I- w    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)) & `! V! z2 Y9 q/ @+ @) e2 W1 C, o. S
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
8 I2 O/ S# R1 L/ c$ t- }0 n1 X0 g2 G    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) * F& A9 ~, `# r
    Call PrintDatabaseInfo(divSet(8)) / W3 G2 Z8 s* @4 _2 N
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : H4 q: r5 z1 E7 l1 g; X  V
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
  f6 E( C1 B$ W8 n' x# [    Response.Write "&lt;/Table&gt;"
1 ]& |. F3 G3 ~+ c# k   End If
- q$ G6 T' Y- ~  B) z+ QEnd Sub </P><>'Destructor
: ^! Q$ S/ y; _. c5 E6 a3 V4 O4 BPrivate Sub Class_Terminate() ' h! R9 m$ o, ]5 _- m+ h% A& {
   Set dbg_Data = Nothing
6 H/ V% C) L, F2 ~End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 P8 ^! ]8 y2 f) BCLASS debuggingConsole $ j8 t& ~$ _- ^, p( S" a" z/ h8 k
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
% p+ B1 E0 f7 ^$ r&amp;n. |! `# g; D# J% n2 N7 S/ p2 g
bsp;
6 v8 J& ?) L0 x& @" a* T. m* cProperty Get Enabled===[bool] Gets the "enabled" value 4 l- t; U3 S: F2 D; \$ X
  ) V. w+ N: ^$ u/ v9 f4 D. n
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
5 @( R3 Q# q3 U& {0 Y  
0 Q) v0 y8 v8 p; N- R* m" zProperty Get Show===[string] Gets the debugging panel.
! {& F& E( \! A( `. z; ?; \, u  b  
+ }9 }! g* O1 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 n: d: @  r* Z, x
Public Methods </P><>public sub===Print (label, output)
/ I$ c4 G) Y3 |+ f( e; _/ C% X   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ) }/ v9 I/ T) Z
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 8 s; q7 {, @! g4 g/ w
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
$ o7 q7 N! O9 ~- N$ i. RMethods Detail , v: e4 Y  m( B3 P6 R
  ; t- _( J8 r& g* e8 W/ Y
public sub===Print (label, output) # C( E2 z) `5 G1 W' |# z% A
Parameters:  9 E: k& Q1 e9 Q; {
   - label [string]: Description of the variable " Q% ^0 B! d" l1 U, t
   - output [variable]: The variable itself 0 `+ D/ m1 n. b2 e
  
# u  W6 B( `5 |& z" I, {public sub===GrabDatabaseInfo (byval oSQLDB) 6 ?3 r1 Q0 s3 L( Z  g
Parameters:  
" j$ a: Q( i2 p: M7 ?/ T9 _7 O   - 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-4 10:14 , Processed in 6.847184 second(s), 56 queries .

回顶部