QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
) V& b5 N7 y' i<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
! Q$ n  Y4 S! l- h0 ?$ p% ^使用方法很简单:
1 v1 D% U) r8 Vtest.asp </P>! {( u1 j. I( t0 h( a5 G
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; % J4 z% Z& Q2 d6 \% y- H1 g
&lt;%
7 |0 R: b* l: S1 B# g( O* koutput="XXXX" ! F! E  N6 B0 F* \6 X% y
Set debugstr = New debuggingConsole 4 F  _. `8 k- @7 ]
debugstr.Enabled = true
) V% ^9 v7 v" `. L$ ?- L  c   debugstr.Print "参数output的值", output
% j: A9 A' [, \" g' ?   '…… 2 A3 ~) R, r% l4 e: K. L. _3 v
   debugstr.draw
2 c1 N( D; }! L4 K0 K, DSet debugstr = Nothing
. R' K5 ]4 X) I  O%&gt; </P>
4 Y0 K2 L. U+ r, T) b! r<>=================================================== </P>
) I; o5 l" {( b" A8 w, Q! D: s% S<>debuggingConsole.asp </P>& v" f5 D3 ^' j: D& j8 H
<>&lt;%
- ]3 Y: C- U( J# AClass debuggingConsole </P>. D% A+ D7 ~# c1 Y& c! c& r/ U
<>   private dbg_Enabled * L6 v$ A' t+ z7 \4 }1 K! U% z
   private dbg_Show , l/ x" l/ G( }3 _' |, K6 b
   private dbg_RequestTime ; {* Q7 x+ N. ^) ^
   private dbg_FinishTime
2 K3 D  J4 ^/ s. ?% w   private dbg_Data
0 K  O/ y( C3 a, g+ L/ T   private dbg_DB_Data 0 i' [7 G0 C  p3 Q8 n2 g
   private dbg_AllVars
4 n! ]' D: [  T- [/ b; i) X3 T   private dbg_Show_default
# y) M6 V2 s: h  O) K   private DivSets(2) 9 `/ U1 G' m, k4 M- [' ?! K, d
   8 l" `8 U, E8 r& [' C6 ^& S1 s2 F
'Construktor =&gt; set the default values
& T% n* a0 [# j' GPrivate Sub Class_Initialize()
5 R6 |1 C  w4 h7 r6 r   dbg_RequestTime = Now() ' \9 o8 F* f' r5 l9 o
   dbg_AllVars = false
/ T' c  x" M5 x( w6 E   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>3 ~9 H0 H" G6 j3 M3 F
<>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>
( X9 j# @9 C3 g% @7 n0 T<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;2 M' R' E5 C/ 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>9 m5 ~8 T& W. C/ _3 Q* g
<>   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># F; X; q% r$ Q' q$ d3 m* m% x" @' r
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
+ v# d7 [' y/ BEnd Sub </P>
. X% V+ ~5 \' ?/ a<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 6 H. L% K3 N, i
   dbg_Enabled = bNewValue ) y2 L; L% D, [; T+ \- J) B
End Property </P>
5 n( S7 h' d4 l, p/ G$ u: y2 X# ^<>ublic Property Get Enabled ''[bool] Gets the "enabled" value , S; J6 N8 b* P6 U
   Enabled = dbg_Enabled 8 F/ H$ a* [8 K2 }
End Property </P>! a, z' C3 Z* d/ t, I$ _0 ~1 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
. ^# a. K  Y$ g: T   dbg_Show = bNewValue & ^/ j" z; X' H% e( s! D$ w, @
End Property </P>8 h, m! [+ x/ @2 a# {
<>ublic Property Get Show ''[string] Gets the debugging panel. % M) J. g1 ^2 P: Z5 R
   Show = dbg_Show
5 ~: z5 U9 V+ \% K6 I, N# FEnd Property </P>
+ F4 {& ~  W# a$ L0 J<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false   ]- c- v. R! p5 n* n+ e5 ]5 R
   dbg_AllVars = bNewValue   l5 `" a' E) N: W- y8 D
End Property </P>4 l5 l5 W  A3 f5 b3 E
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
# P+ V) h" B; E# T# L) C   AllVars = dbg_AllVars * @# d( ?& V4 J1 _* m' i- ^* j
End Property </P>
: D* D+ \# ]' j- x<>'***********************************************************
( b* O4 N! a! {! T''@SDESCRIPTION: Adds a variable to the debug-informations. . p) ]5 `  j, J8 N" L. i% T; Z: |
''@PARAM:  - label [string]: Description of the variable + n$ C+ \6 D; ~. W: z* Y+ j3 k
''@PARAM:  - output [variable]: The variable itself . Z3 B2 S3 n6 O# h
'*********************************************************** $ k+ x) `/ X& h* R# z: Z
Public Sub Print(label, output) 8 A' F6 P0 m' u) L
   If dbg_Enabled Then & F0 w3 R/ t" j7 w, n/ A
     if err.number &gt; 0 then
' k( j( j0 e* H0 `  v       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 4 Y$ ]2 d& ^5 @# ^
       err.Clear
$ e4 C- }# B. W     else
/ L/ C+ N, }. p. U- g  H& [  c' N       uniqueID = ValidLabel(label)
9 a' i/ ^# z" F, Q5 V( t* a       response.write uniqueID 7 M0 y; H" C0 l. r; b. R9 E' n& Y
       call dbg_Data.Add(uniqueID, output) ( ?* T4 U6 G$ ~: V
     end if
4 Z) o4 V9 T. D( ^   End If
1 w. f/ R9 N5 t+ p, K9 AEnd Sub 2 \: d% T0 `! r
  : E; v. Y2 M# P: g" Y6 q
'***********************************************************
) M0 Y9 m5 ~2 {0 D- }1 P  u'* ValidLabel ( ~2 Y" J0 N; H* {1 V4 N7 ]
'*********************************************************** 8 {0 {) \3 A+ t! Y' x
Private Function ValidLabel(byval label)
) M1 b: G8 H7 p7 E" o$ `5 l   dim i, lbl 8 F" C+ m) u  x% O
   i = 0 : B+ F# \0 O9 s- S' G
   lbl = label - _, o5 Y$ S$ f
   do
; x2 F8 q" r% g3 O6 V8 G   if not dbg_Data.Exists(lbl) then exit do " |; o0 M. A$ h9 l$ ]3 ~
   i = i + 1
" d! S7 f! Z# Z, c* z8 l   lbl = label &amp; "(" &amp; i &amp; ")"
+ V  _% w! \8 m" B   loop until i = i
2 y2 Y( x( L6 g; F2 `  
3 k/ a9 e* x$ o" v9 [* |# O4 k. i   ValidLabel = lbl
) P" E1 z$ x4 n$ q, uEnd Function
5 r) ^- e: @2 k# S" {$ a: B  
" l+ ?& U) H4 q; W'***********************************************************
0 A9 _, B' b' L9 g9 r'* PrintCookiesInfo 5 l7 D+ P. w7 a9 d! Y: P1 V7 f( Q
'*********************************************************** . W& L  j3 U6 l0 R% p& E
Private Sub PrintCookiesInfo(byval DivSetNo)
7 X! O1 C: O: C9 Q8 C& v3 Z   dim tbl, cookie, key, tmp 4 \$ q# K8 }$ l' E" ~/ q
   For Each cookie in Request.Cookies % g; v0 ~* W+ |# E+ p+ g
   If Not Request.Cookies(cookie).HasKeys Then   U! _+ A' U7 x
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
4 O+ _' e3 K/ @2 C  T8 f- y, y   Else
/ _6 t1 Q$ \3 f. Q' @     For Each key in Request.Cookies(cookie) 4 i& K9 Z# J+ p# e# Y  H1 [; j: g( b
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
; a' \; _* D& ]& vCookies(cookie)(key))   
: w1 n4 A9 @* ]$ @   Next
- N. Y. I3 E7 ^* W$ Q$ Z   End If 9 i5 M8 J3 N2 l0 v
   Next </P>6 ~& m) c2 b4 \
<>   tbl = MakeTable(tbl) : w9 A9 r# {$ w8 w6 G3 f
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 0 l( i5 }/ \8 b& `$ B0 M  p5 p. U
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 0 O# ~3 A/ \& [" g5 h
   Response.Write replace(tmp,"|", vbcrlf)
1 {' H7 }/ L( u3 g4 P; G; ~end sub ' d1 ~% S2 {3 F$ g
  7 a" U5 |1 q- o5 X
'***********************************************************
# S# [' ?7 y# o$ L+ I* x0 D'* PrintSummaryInfo
+ L$ L7 r) t* I( n6 @2 _'***********************************************************
! A; }9 G% D" C7 G  fPrivate Sub PrintSummaryInfo(byval DivSetNo) . y+ p, _9 a) d( x
   dim tmp, tbl . l5 g: n0 J( A( |6 m
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) - Y" [1 e8 q- g( p  Y
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
9 ~0 p9 C# M$ |4 q9 Y1 e9 m   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 9 d' U/ L3 j# h' r  [; O) E; g8 o' v- Y
   tbl = AddRow(tbl, "Status Code",Response.Status)
. b8 d1 P/ M3 H/ h: d# h+ N) \; D   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
( n2 O$ t$ j- [. x# x   tbl = MakeTable(tbl) 7 k* G% x$ v5 x7 K
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ! Q4 c  J" \9 ~$ \- N& [
   Response.Write replace(tmp,"|", vbcrlf) 6 }5 k  W- }$ B* n6 Y
End Sub </P>
4 q( g( j1 J! R% P+ i1 \<>'***********************************************************
4 W# g9 C8 k6 g. x  w''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information & n3 D  j8 c4 Q9 V2 i
''@PARAM:  - oSQLDB [object]: connection-object
3 V. _2 S- U; t'*********************************************************** 7 C2 C% m2 n: \2 I
Public Sub GrabDatabaseInfo(byval oSQLDB) $ g9 D& \: o8 T1 ~4 P
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
) t7 L9 r. `2 R2 V* L   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
5 y+ b9 }* y5 g1 _# m5 @5 l6 x   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"))
/ x0 D! Y% ?2 N$ U- X+ t   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))   M0 W, m0 I0 U. p$ x' M
End Sub <>'***********************************************************
3 [) ^6 V$ m+ F' |'* PrintDatabaseInfo 5 Y. Z& s, y* k# H! B, r" |  F. }6 J
'*********************************************************** ) P0 g  M' {3 _& v( K, z
Private Sub PrintDatabaseInfo(byval DivSetNo) 1 G  Z8 q! S1 c) X6 s
   dim tbl
" e( I+ ^2 A: e7 q1 a1 R0 _0 ?, S   tbl = MakeTable(dbg_DB_Data)
  r( j- S2 t/ g+ o* _   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 6 L3 V, }8 c9 ~% w) |  B
   Response.Write replace(tbl,"|", vbcrlf) ! c- F1 u3 \& {& w/ v
End Sub </P><>'*********************************************************** ' `5 J/ T: q" l5 M# _; B3 G
'* PrintCollection
1 H$ i- \& b1 R2 g2 W# |'***********************************************************   K& \7 b) p5 j- h2 d
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ) F0 o3 d1 ^9 X
   Dim vItem, tbl, Temp
4 p. e2 }) i" K   For Each vItem In Collection 8 I/ k- S$ |# l) H! L
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
, D# `) R( }/ O- d, S       tbl = AddRow(tbl, vItem, "{object}")
) I( _- P# i$ T7 C     elseif isnull(Collection(vItem)) then 5 ~9 ~, o" w' L6 d, `: ]
       tbl = AddRow(tbl, vItem, "{null}")
. U9 U( C0 s0 ~6 f8 U6 M# h' g     elseif isarray(Collection(vItem)) then
4 E5 Y4 z! i0 Z8 G: _8 {       tbl = AddRow(tbl, vItem, "{array}")
! B- ~% c" T: ~/ j     else 3 h# V$ m0 a9 i0 S. b5 J
       if dbg_AllVars then
0 N) O. I3 e0 k       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ; r3 P* r. L4 E7 \; I: V+ x; @
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
8 q8 q2 D/ Z3 L! T3 @" n: _       if Collection(vItem) &lt;&gt; "" then
( m( K& s& {- N2 f$ @       tbl = AddRow(tbl, vItem, server.HTML& N% a( d5 O: s1 R8 |3 n+ }1 N
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
5 ^& q) ^% x2 E4 e       else
& C8 d9 t- I' y! n7 g4 t. W, P: B8 @       tbl = AddRow(tbl, vItem, "...")
; G- m& a) d; ^- o' n  M       end if # {; ~* t+ w  \& A
     end if
1 C! q1 n/ B  j/ [! V   end if
2 O0 d& n& {0 Z) V( \1 @   Next ) ^: M8 h, @) P6 ]
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo / I% o+ ~+ J" P/ M
   tbl = MakeTable(tbl)
; x- c3 H2 @  `   if Collection.count &lt;= 0 then DivSetNo =2 9 i% ~! S. h1 ^. ~. K
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
3 d& f1 Y: u+ H     tbl = replace(tbl,"#sectname#",replace(Name," ","")) & V2 y) N+ ?) h& u' h
     Response.Write replace(tbl,"|", vbcrlf)
+ j1 ^6 P5 e- [9 U5 e) p- q# Q5 l. QEnd Sub " n# g8 z- y0 X$ A
  
- I. p: }4 n4 b1 J4 g8 X' G'*********************************************************** % B- n8 k9 O9 p" \& s
'* AddRow % D8 M" a) [% L' j; Z2 G
'***********************************************************
# f" |9 |. x4 A& M( Y5 v( D- gPrivate Function AddRow(byval t, byval var, byval val)
) u( m! ~- `" s2 l   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
2 c% Y% O" i1 X9 ?! ^6 w   AddRow = t
& ]6 E9 k3 w0 k; ^! JEnd Function </P><>'***********************************************************
5 B/ N, h# t; X0 `: q4 X0 V; i- L'* MakeTable
6 {# v$ o9 B! {/ I( S5 r, u'***********************************************************
5 g3 y$ s4 w  |; d6 S" `; r7 GPrivate Function MakeTable(byval tdata)
8 f: J; u$ M  L# W. P; k) g$ @   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"   n* g' q. T& ~. _) q
   MakeTable = tdata - |  Q+ [( G. ^! G9 M# ?9 s
End Function </P><>'*********************************************************** ( b9 f4 I, c2 V6 Z
''@SDESCRIPTION: Draws the Debug-panel 2 Y. ]5 Z6 I1 Q
'***********************************************************
* s) i3 E0 v. l5 P/ }5 ~6 U, C1 g9 oPublic Sub draw()
$ J& a; C7 R- c: k& k4 _   If dbg_Enabled Then
7 E! ]2 O2 _5 ]% [' W1 S# u+ [* h9 S# X     dbg_FinishTime = Now() ! v0 N* H+ W# N
  $ ?; d( n" G7 l2 ^, B! {; l  E% i: A" X
   Dim DivSet, x
* w  V4 E7 p. ?3 s   DivSet = split(dbg_Show_default,",")
, M! U, _6 v2 {     dbg_Show = split(dbg_Show,",")
1 F( L& A/ R) y# {  N) e  
. Y& O. D, l2 C) r   For x = 0 to ubound(dbg_Show) $ P! E& Z4 p7 K
     divSet(x) = dbg_Show(x) ( f" P' u7 \! Y0 l. |
   Next
' U' ^6 \' u& g* F  ) h+ ?3 I. t7 ?+ X$ A9 V7 m$ F
   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;" % _& M& s9 d& n8 `  m
   Call PrintSummaryInfo(divSet(0)) " A4 W! I6 Q, {/ O: p3 Y3 _
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
% F3 Y; x. b8 c% z0 l3 S& t! n    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
" T- W. @( v, X. v' d9 S) c    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
9 Q1 i) N: _$ N/ Y    Call PrintCookiesInfo(divSet(4))
4 b# ~$ P4 J0 t( C. M9 M    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)) 8 R" p9 E, A9 X. t9 b4 J9 D% X1 ^
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ F: P* s% g* v2 Y# n5 Z9 Y8 n7 o    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& h* r& A! B1 i; S9 `( x    Call PrintDatabaseInfo(divSet(8))
: i6 e2 T% h: R. j5 }0 W    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") , O/ C) _. y4 l8 G
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 5 }! a0 G; D. L2 x) Y: ~
    Response.Write "&lt;/Table&gt;"
# A0 [6 n4 G$ Q. c+ h% t: E5 n5 {3 m   End If
' |8 }3 y# k; r! c  y+ y9 tEnd Sub </P><>'Destructor ) \6 L6 i3 |6 f0 V! U" V
Private Sub Class_Terminate() & P! R; K# n) t! m1 k
   Set dbg_Data = Nothing
& m& @  Y4 l5 IEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
' [5 q1 W8 r0 v1 g- CCLASS debuggingConsole
& p; f3 |! z6 }Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " \; I" q5 z  T8 z" |9 [
&amp;n
) M% X" i6 G; B3 B8 N' ~bsp;
' c6 g* d5 p0 tProperty Get Enabled===[bool] Gets the "enabled" value
  H) y9 u4 b0 R4 m/ I# `  
. |/ \1 A1 E' U- Z+ f# w% _& xProperty 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 * |. J7 j: I6 K8 r' u
  
" j; l4 v7 Y8 O, [: L6 CProperty Get Show===[string] Gets the debugging panel.
  G$ G& d0 J0 l5 G; _  s4 J  
5 s1 F$ ^+ p  h- b9 A. K3 ]" Z" PProperty 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><>--------------------------------------------------------------------------------
- u/ V/ N. r  d2 \! q! yPublic Methods </P><>public sub===Print (label, output)
& i& ?) S$ y+ S9 v1 r   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
! u& J) D+ @0 F; m! I9 Q' D+ a" P   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () , T& x: f$ ?! `3 O9 R
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
" c; C. k9 r8 i$ [1 Z; dMethods Detail
% q+ l2 Z+ x# d8 c+ T8 P  5 U% T8 K2 U, ?; S( u1 @" o  \+ M
public sub===Print (label, output) 8 f/ z7 i: F0 N' P: ~* m  L. s
Parameters:  8 Q9 g) w! A8 y* n$ X
   - label [string]: Description of the variable 1 ?; v2 B% ~: B( v. x
   - output [variable]: The variable itself
% A  _) y( @1 @1 g# u3 x  2 D! \2 Q) Y3 @/ z( F
public sub===GrabDatabaseInfo (byval oSQLDB) ' l7 p0 h) D0 _3 N# b
Parameters:  
7 L+ D4 j: f* A/ t9 \+ K   - 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 06:14 , Processed in 0.566300 second(s), 57 queries .

回顶部