QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6495|回复: 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% f# H2 u. u/ p; Q; d+ E<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( E0 P. L6 R8 T- e5 b
使用方法很简单: * U: t0 z* ]) x7 R. P5 B' `
test.asp </P>
: [& V% n- D* h, c+ W# [- O" I+ M- K<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
( [; r5 _  b& k5 f7 C; M" K&lt;% 7 u! k1 ~) W' Y) Q# q" L& z& W
output="XXXX" 9 j* V# ^) \0 N2 O( F7 j
Set debugstr = New debuggingConsole
# Y: ^  ]% o3 D! s5 e% y! |debugstr.Enabled = true
9 e7 L8 B. e9 H   debugstr.Print "参数output的值", output
4 j3 o4 j; R' h   '…… ' N: |' d( E- V: H& U* e
   debugstr.draw $ G4 m. x' b1 U$ i
Set debugstr = Nothing
+ H. T+ u2 ~3 i) C+ I%&gt; </P>1 X6 y* Q# e/ f! E( R$ E
<>=================================================== </P>
2 ^2 n4 E% p- t! E; e" N5 j1 d<>debuggingConsole.asp </P>
% o5 P* _& T4 y3 H0 G! I<>&lt;%
8 C6 t2 Q0 F5 C0 z: bClass debuggingConsole </P>
" K8 ]$ i; H' F<>   private dbg_Enabled 6 d" P+ c6 p9 A0 C! G
   private dbg_Show
+ {6 T  k# H* D2 I- S   private dbg_RequestTime . x$ Q" i- K. m) P2 E% [  R; r
   private dbg_FinishTime ' G/ g" u. \: B2 ]2 b7 g
   private dbg_Data
( @( B3 \& q/ Q+ Y4 x/ v   private dbg_DB_Data 4 o9 k) ^; K- {
   private dbg_AllVars 8 S) J7 q1 W5 \% d( u
   private dbg_Show_default
: w9 P: d; N0 q  W+ N: H   private DivSets(2)
) C- Z$ E1 E( C- O   % ^/ C/ |+ Q+ O  X& m( y. n* F7 H! B
'Construktor =&gt; set the default values 7 a) g. c7 |! I! y& l! p
Private Sub Class_Initialize() " m6 y* b7 @0 h" e  c1 S, Z& R
   dbg_RequestTime = Now() 1 h' {  ^6 t' ^
   dbg_AllVars = false 1 g0 h+ i3 b# g. ?4 \
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>) z2 F& V' c% i2 u
<>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>( R  s5 l1 H. t+ f( ]) E
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;- G# E$ y: Y! d! U8 c$ l
&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>
( d+ b/ X  N. n<>   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>
! }; \( r: u; v+ ]4 f" m% P0 o0 v<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" " N* V1 F8 K* w* K: g, [
End Sub </P>
: {6 _% V4 J3 L; a0 S& {8 o4 {<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
. y1 `0 {$ j( P2 i" M   dbg_Enabled = bNewValue + C. b( L; U8 [) u
End Property </P>" N5 M" K% A! A4 P, C$ P5 o% o3 _
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 1 ^6 q, [! Y7 C( {7 H! y) y+ D
   Enabled = dbg_Enabled ! a9 o" @3 O: N2 G8 a
End Property </P>' j2 L" t- J6 w! o) I+ O
<>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 ! i8 r# Y& K4 e3 s& z1 k/ k$ N6 N
   dbg_Show = bNewValue 9 V3 g6 x- M/ C6 G
End Property </P>
8 p) N2 F; K1 e! Y3 u1 m6 ^<>ublic Property Get Show ''[string] Gets the debugging panel.
  x# U1 ~  }- y, U! @6 e# V+ x   Show = dbg_Show & Q6 W" r7 P; A5 J
End Property </P>
! L) P+ S8 ?3 }<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
# x  s3 K. P5 t& d4 }# R9 E$ {  y' D4 \   dbg_AllVars = bNewValue
) j* N0 K% d1 P9 q1 S7 F  CEnd Property </P>
) u( E/ _- G& y3 H4 M* g2 B. W7 S1 a; e<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. , G3 {- I0 _& z
   AllVars = dbg_AllVars 8 X5 r- f& l3 s, j' Y" l
End Property </P>* t, a: }6 R# V
<>'***********************************************************
' d. v! D* Q9 U! x  i% R''@SDESCRIPTION: Adds a variable to the debug-informations.
3 g8 r9 @8 @4 B7 c, a* G: h! t''@PARAM:  - label [string]: Description of the variable   W9 U: T2 t1 C  ]% y
''@PARAM:  - output [variable]: The variable itself $ O8 C- R. Q* A+ r# e) J
'*********************************************************** 6 f; z, B' a! o& N8 F
Public Sub Print(label, output) / v- `+ z+ C; M5 w" a
   If dbg_Enabled Then
/ F' u  j4 H* k; Q     if err.number &gt; 0 then
( j: |, p' S2 b, h, ^) [% ~# H       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
8 c5 F3 Z& O, E$ e/ `/ U       err.Clear , q8 J( v9 l! v1 n, _
     else ; n+ u1 D; L0 `/ ~7 d4 m
       uniqueID = ValidLabel(label)
/ O  Y! m. g$ Y: T       response.write uniqueID & K9 o1 q8 G- L6 a: ]- h# p* I
       call dbg_Data.Add(uniqueID, output)
9 A9 g) d6 r7 M0 O9 k: k' U     end if
, S9 l; x: }6 @$ _   End If
: m4 t$ h$ T$ sEnd Sub 4 e# i* C6 t7 }
  
" P8 h, V* I' o" w% i'***********************************************************
' v2 K1 {" i6 h& }# d, {'* ValidLabel " q' V6 P4 W+ h4 W. g+ s" r+ V* s
'*********************************************************** . B( m! X& n( Y) X5 M0 v8 L
Private Function ValidLabel(byval label) 4 `( }6 \) `8 F, [( z% R# R
   dim i, lbl
! ]) Z& ?) R( g+ Y   i = 0 + d8 ~* I, c) N7 s+ y
   lbl = label
- K6 v1 X' Q; X+ a5 D- p) R: c   do
$ X) w7 _. D7 `4 K' L   if not dbg_Data.Exists(lbl) then exit do
1 |6 r& e% h+ Z: }8 q2 s3 l6 F   i = i + 1 # v: r9 U! s& I
   lbl = label &amp; "(" &amp; i &amp; ")" - \+ s1 J7 \; Y- c
   loop until i = i 8 f' [6 f& \. h: F
  * {3 n0 l: w( N$ e$ E# Q8 t
   ValidLabel = lbl ' ^) R: F9 o/ q' U" w6 R6 p9 q
End Function
: |8 c: j$ P9 u, ^  
: i) E( S. B" r& U) ^0 P'*********************************************************** ' r! j) q7 t* W! O# W2 i
'* PrintCookiesInfo
7 a4 L1 |; i4 e1 n( }+ j0 z. o'***********************************************************
, f! r$ |" n% B3 k: C8 lPrivate Sub PrintCookiesInfo(byval DivSetNo) - i0 {2 V$ ^& w
   dim tbl, cookie, key, tmp ! v: x, f; P0 M1 H  K  E* W
   For Each cookie in Request.Cookies , f4 U, T. C- W3 K1 P& ?. ~
   If Not Request.Cookies(cookie).HasKeys Then
- I  H: g- w: @+ N     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ( X; ^+ O6 A6 K% i
   Else / ~  w) e" p% X: Q  p
     For Each key in Request.Cookies(cookie)
0 r& {  ?: O* i     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. # @6 Y* v0 j3 k! b9 g) K6 [! A
Cookies(cookie)(key))   8 z* B% v& o0 I9 [# D3 K0 @
   Next
6 s& R- v3 G6 s- F; f& y$ j   End If
/ j8 |( A8 _1 w! g   Next </P>( D  q/ }" `6 `7 w* f; d
<>   tbl = MakeTable(tbl)
! X# e5 e; K2 C# r8 Q   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 $ a& `+ \( x/ ^7 o% I; q1 {
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
+ a2 o3 b3 ]9 H3 h' E  [7 x# ]   Response.Write replace(tmp,"|", vbcrlf) . r& t3 R3 ^; ^% E4 g) Y
end sub $ K- Y5 T9 {( V* H2 L9 Q3 ^$ p
  $ m4 b$ _6 i( ]5 j4 m: L/ ?! @( Y
'*********************************************************** 6 l; }* F3 q5 G7 _2 s- O1 k0 g
'* PrintSummaryInfo 8 k5 N8 v& _& @% e- [/ v; o. y
'*********************************************************** ! M6 M3 |# {. b3 ?6 u3 ^
Private Sub PrintSummaryInfo(byval DivSetNo) . z6 X) ]0 w& c# {3 L0 j" s8 g  m
   dim tmp, tbl $ L2 R1 Q2 F0 d
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - p' M* m5 A, F
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
) U+ O% a4 X7 Y" U0 j" V   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 E7 i- F0 g# B# V- u* ^8 X   tbl = AddRow(tbl, "Status Code",Response.Status)
% \1 z, ~/ g3 q1 z+ t   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ; Z% F! d7 K& c2 a2 n# s2 x
   tbl = MakeTable(tbl)
: i" g( p2 c+ ?   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
2 C+ f% _5 b: k: X   Response.Write replace(tmp,"|", vbcrlf) ' v* t* {1 m0 S/ Z" E$ B% [& s
End Sub </P>; e" G& N# T, i* R# N5 u- ?5 ~
<>'***********************************************************
, I0 v; Q- f, t5 |''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 2 Q* c1 s' l' A5 e
''@PARAM:  - oSQLDB [object]: connection-object
$ G4 a3 D% N: ]/ H/ {9 j'***********************************************************
. F9 {! E% h: B% p$ CPublic Sub GrabDatabaseInfo(byval oSQLDB)
5 A3 m7 B+ U4 I   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 3 _4 R/ w+ I5 w( [3 Z6 _
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
1 ~/ n+ r$ M9 C+ Y4 `) u0 E   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"))
: w5 P. h. {8 B) K5 t7 p2 A. s   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) % S" J/ }4 Y$ p; n3 V
End Sub <>'*********************************************************** ; i7 \4 K) ^) R5 y
'* PrintDatabaseInfo
) ^" m* d; D$ `' q( z. p0 O'***********************************************************
; G3 A  j8 L. {4 ^0 z. ?6 tPrivate Sub PrintDatabaseInfo(byval DivSetNo)
+ y, ~6 u: M% p- h& @   dim tbl
" ]/ g$ H; z: I& W   tbl = MakeTable(dbg_DB_Data) , @( q4 G) O- O# g% P& f0 o
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
7 P+ K) j# ?/ @; s   Response.Write replace(tbl,"|", vbcrlf)
" n+ \1 K9 W2 Q! y0 r6 M% z7 PEnd Sub </P><>'*********************************************************** ( D' I3 H/ `$ D) I; K% H- W* c
'* PrintCollection ) E( M4 z5 S& ]! c
'*********************************************************** 7 A6 _. X  Q* u, a; v* n8 r; K; o2 m) R
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 i. w$ D3 I  B   Dim vItem, tbl, Temp % n% x9 L: l) U9 _
   For Each vItem In Collection ' V" ~; D5 Y& \+ @6 B" a
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
  B  h/ w8 H. W% W) X! s       tbl = AddRow(tbl, vItem, "{object}") - m' A! C8 A  G# H0 F# N7 h
     elseif isnull(Collection(vItem)) then 3 Z( n* F4 y/ v8 `$ @  O, c
       tbl = AddRow(tbl, vItem, "{null}")
* L; B3 H7 Z$ e     elseif isarray(Collection(vItem)) then
/ ]0 o" r4 w2 `, x4 y       tbl = AddRow(tbl, vItem, "{array}") % \8 L/ k7 q9 N5 W2 J  @8 l& p% {
     else
# `. E$ g6 R/ ?$ l0 t1 K       if dbg_AllVars then 8 `8 @/ R7 b1 C# O; Q" O
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 1 g; N9 ?, k( A/ Z& n4 Z! W' j
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
* Q, d4 W( e: ~1 y9 V) j" [       if Collection(vItem) &lt;&gt; "" then - s3 l5 \5 A; _. \
       tbl = AddRow(tbl, vItem, server.HTML
6 K& w; F  \6 L; FEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") + b% O% n* k: Q5 r9 h/ B
       else 6 ?% B# W4 j8 G# r) u
       tbl = AddRow(tbl, vItem, "...") " G6 Q5 e2 \4 C- G. h6 d4 z" `
       end if
7 @" x( p' c) o1 V- ?+ F     end if
/ R/ y/ V5 i2 ]# J. x* @   end if
' w: k" h4 r  ], P/ t9 J  \9 t   Next
5 G7 S& H  \6 d; [: v) ?   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
( B# B: V2 K1 h, j" {   tbl = MakeTable(tbl)
" k( N) e7 c/ i/ W   if Collection.count &lt;= 0 then DivSetNo =2
, h: a* C3 {4 w! S. Q% X: H. K( B, |     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) $ O6 W  H5 ]: i* U, s$ ]7 i
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' `" S- I. G9 h$ k
     Response.Write replace(tbl,"|", vbcrlf) 4 R, A$ e2 w2 V& t9 K: A! w
End Sub 0 W6 X7 P& ]- d! \, Q! H) o
  - G& n, L1 M, ~$ R  U# f/ L& c
'*********************************************************** , g4 T" k% x0 a8 d
'* AddRow
0 V; a* Y7 l2 x9 M- z; V'***********************************************************
' n! d* B+ w7 @& DPrivate Function AddRow(byval t, byval var, byval val) # q5 i5 a: g: E7 u/ Q( S9 y
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" " _$ T6 {6 s5 ?( N
   AddRow = t + h5 g" u0 w2 S
End Function </P><>'***********************************************************
- j% y' l- p0 Y% {. u'* MakeTable
3 N+ D* N* o$ c& d3 d'***********************************************************
7 T* h; _" y6 |* |' IPrivate Function MakeTable(byval tdata) # o6 B4 W1 R+ ^& C
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
5 S# z% P6 m* E4 l   MakeTable = tdata 9 q! U1 n/ ^* Q
End Function </P><>'***********************************************************
0 y3 ?9 I+ O3 r! D''@SDESCRIPTION: Draws the Debug-panel
8 G, l7 O2 O8 l% c$ _  |'***********************************************************
3 S- H" f% G/ u% ?, m% d2 mPublic Sub draw()
& q$ a0 \' `9 j) {/ G) w& x   If dbg_Enabled Then 9 J& Y0 X- z1 y2 {
     dbg_FinishTime = Now()
4 M1 B- u- o* o% E# l  9 D+ l* |' A7 b9 n- q9 N# T
   Dim DivSet, x
" W; T" a3 d' C9 l  Z   DivSet = split(dbg_Show_default,",") ( r* a+ e7 ?4 {: Z
     dbg_Show = split(dbg_Show,",") / ?+ H* O$ @, i) P9 a" p5 P8 v
  
; M- l# ^" X( w' p4 e# c( X' r   For x = 0 to ubound(dbg_Show)
4 V8 {- o9 M0 p5 }! ]9 b     divSet(x) = dbg_Show(x)
# a  `5 {' u5 e  {) C; a8 C. c6 u   Next
- |, }' b$ I( g. F  
( f; U$ |9 C( f$ a5 I) i   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;" " G8 w2 y1 D, E1 r# x1 T& d! l
   Call PrintSummaryInfo(divSet(0)) - @1 h. J6 f! o1 }* z) ?* g
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
, R! N2 }- F4 T& a    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
5 C8 G9 Z+ n; Z" t    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
: [' ?; \# d/ G  }, O( C& k5 T1 o5 d    Call PrintCookiesInfo(divSet(4))
) y8 ]2 ^, `6 P: Z    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)) . ~; n. e4 G$ C
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ |# K/ G, \: x, J' ?$ m    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 0 D# ^6 x7 k+ h; p, R8 Y' _
    Call PrintDatabaseInfo(divSet(8)) # |: ^) U( Z! ]+ U% H
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
. T$ i+ E% j2 o3 H' U* ]    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" C8 z/ t$ v& x1 D' b' s7 I    Response.Write "&lt;/Table&gt;"
, O9 @% a+ D- y9 E   End If 0 v1 ]3 U- X( M3 p
End Sub </P><>'Destructor . B5 _/ @: n* H
Private Sub Class_Terminate() 8 M! S$ {. m: F* s8 l
   Set dbg_Data = Nothing ; a- [! ]3 l& ]
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
( \& G) R3 L3 q0 @0 d! uCLASS debuggingConsole # S7 B+ F! A1 I/ z8 y; {8 z1 @
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 3 G. g% I9 x' W
&amp;n
1 H) n2 Y, J, Nbsp; ) _  h4 I4 F) }
Property Get Enabled===[bool] Gets the "enabled" value
0 Y: Y6 s$ v0 m; G0 P  
+ v% U7 t/ C' O$ nProperty 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. I1 [/ F$ s0 m/ ~9 ?
  
7 V7 J, l+ W/ s& L* Z  TProperty Get Show===[string] Gets the debugging panel.
6 Z$ U0 w7 R: a; S* R8 O( z) \5 A. u% U  
& _3 Q# w' C0 M9 G8 |1 qProperty 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><>--------------------------------------------------------------------------------   o) P. q7 ]4 ^- b' m- u  o
Public Methods </P><>public sub===Print (label, output)
2 g  N6 ~3 T+ i6 v$ e/ G1 x( j; U* H   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
) J2 ]  e* H  @; `1 f   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () % q$ W" C$ m( s
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
2 a4 N7 U5 M. j# j; A. zMethods Detail
7 N4 f- }- y2 a- i3 a5 W  4 ]/ R' g! U3 C* Q
public sub===Print (label, output)
0 u, Q& E! Y5 V7 QParameters:    H! Y1 N: f9 \1 Y
   - label [string]: Description of the variable . h5 a: g; |3 U/ q
   - output [variable]: The variable itself : H3 H+ @2 B& f& ?" f
  " y" y! C% M, Y  d1 l
public sub===GrabDatabaseInfo (byval oSQLDB) 6 m" P# {" s0 I6 Q
Parameters:  
* k# o* o4 }9 i4 i   - 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 00:30 , Processed in 0.479004 second(s), 57 queries .

回顶部