QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6682|回复: 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( T% Q7 X. L" V; }. b  K  m
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ; \+ u' z2 P  l  S0 G& ^3 Y
使用方法很简单:
* L3 b- s+ u2 l7 m6 O" C# Dtest.asp </P>9 g: J$ \3 E. g
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; - n' g8 {- F0 L7 e. T
&lt;%
& ~' G2 D6 G! w2 zoutput="XXXX"
# V- l/ t5 w: L$ xSet debugstr = New debuggingConsole
# i- m4 u9 Z6 Xdebugstr.Enabled = true 1 _, i! l# Z5 D9 x* q
   debugstr.Print "参数output的值", output
2 o* @0 H5 L/ Z+ E/ n   '…… $ Y6 T! D0 N- Y: \5 r
   debugstr.draw % X( Q/ I4 ], A/ a3 c
Set debugstr = Nothing
+ `. j; ^6 j2 E8 x9 a! u  P* U%&gt; </P>
& U1 E: C6 b" y- O7 R' X<>=================================================== </P>3 t% j  s, E5 q; H+ V
<>debuggingConsole.asp </P>( ?0 c9 ~: W& y0 t: c
<>&lt;%
: s4 r2 ?$ N0 }% c* A, p- ^Class debuggingConsole </P>
! q& w! B4 c5 H  t( n<>   private dbg_Enabled
" J% i+ m3 |* n+ ]) u; {: ?   private dbg_Show
, A2 I& p3 W9 J6 S6 `4 r   private dbg_RequestTime 3 O0 d, W: m; |8 R  u# l8 L
   private dbg_FinishTime
2 V9 l+ \/ f9 |( \3 y( }8 G/ C6 S8 r   private dbg_Data
' {; ?6 s8 Z7 s4 d- x# M   private dbg_DB_Data * }1 Z% [5 n' [: T
   private dbg_AllVars
3 z: J; n) b/ e8 [& J( J   private dbg_Show_default 6 G; e. V- y# I$ j
   private DivSets(2) : x  {# c' V0 L) N$ h0 w& E4 _
   
; q. V& L! h6 y'Construktor =&gt; set the default values 5 W* O) p8 B% }3 F* |
Private Sub Class_Initialize()
  v: _7 ?% \# X   dbg_RequestTime = Now()
* O# E. W, h" }. N% F/ B" M   dbg_AllVars = false
2 N0 G) [8 u/ K9 W5 ]5 o   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
9 }+ [2 @7 x: J9 ?5 t<>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>+ j/ F; g* `) ?
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
3 E0 B- S7 e3 N! _' 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>
3 X# U9 y) H7 L: Y<>   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>
+ _' {4 c( d6 Z* E' Z<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
1 v  K( N% {, v8 A# L2 tEnd Sub </P>
0 E& \5 S' q) T$ o+ n8 A<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
! s8 k# _7 C, L5 r& H. X3 o' m  t. b   dbg_Enabled = bNewValue
/ _) I5 s- q5 _. Z# t7 _* aEnd Property </P>
/ e! [, l# [, F# _' G" v  H% |<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 1 }% q7 o. R, S/ W- O: F; V
   Enabled = dbg_Enabled 0 q' L- e- I& _0 j/ j
End Property </P>
$ y' `1 G5 v; n1 R  @<>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
6 X4 X; @% d/ n   dbg_Show = bNewValue - C8 [& e; Y5 G) g+ X7 h. j
End Property </P>. q6 x) v& M0 f! F  |5 N
<>ublic Property Get Show ''[string] Gets the debugging panel.
* G: O4 \( N& z) |, b4 l3 U, s( k   Show = dbg_Show
' R. A5 t, j. o6 Z' ?# i% w$ |3 e. fEnd Property </P>7 U* C5 w* R8 g8 v1 n
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false / z! [( e% T$ U1 _8 Y0 G6 U+ v. M/ G7 ^
   dbg_AllVars = bNewValue
: [/ l7 c0 Q, X' |+ UEnd Property </P>
" S! |( l* P6 p! f/ ^6 e8 I<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
0 H0 F4 o: J8 ^( F: A  K   AllVars = dbg_AllVars + f- R) U5 [3 L1 z& ]& @
End Property </P>; ?( y2 V# t2 P" F
<>'***********************************************************
, K( k  Y3 ^8 t1 {$ a''@SDESCRIPTION: Adds a variable to the debug-informations.
0 W/ `& t3 u$ w( S''@PARAM:  - label [string]: Description of the variable
- u( p) f+ v5 p1 G' X( Y( ~''@PARAM:  - output [variable]: The variable itself
! l" f6 J9 v) o'***********************************************************
4 z. T  X& |" t: F$ Z- qPublic Sub Print(label, output) 7 p. T, h' F+ s
   If dbg_Enabled Then 6 X! P- A6 G$ w( g$ X+ h
     if err.number &gt; 0 then : k! F$ i/ _6 V0 ]3 @# v, O# l' y7 Y
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 8 Z: E" E0 [( L, F, k! n% i, D
       err.Clear
, P9 x% Y0 P9 S. \     else
5 o0 \/ O: I% }* K- @/ ^       uniqueID = ValidLabel(label) " b) i' q8 ?/ E: o
       response.write uniqueID
& X9 w' x$ F9 F: S       call dbg_Data.Add(uniqueID, output)
( L  k8 `. n5 p. C! y, O' ?' d) y5 j' z     end if 1 E( |5 j8 L5 `
   End If 7 ~* p% n3 _: s/ y9 g* M8 f5 b# v7 G
End Sub
+ x: U" G+ [$ z. c6 E  [) X  ( T  S2 h- C  c. i( j5 c
'*********************************************************** 6 e+ d+ G: ]9 u: {& {4 N- J
'* ValidLabel
8 A7 Z  s* K* M& p$ f- H8 ]'***********************************************************
1 E) z! w8 p, r& O6 iPrivate Function ValidLabel(byval label)
$ q, U, \, H  Z0 I5 _2 t2 |   dim i, lbl
: M+ v  U5 p: k1 Y   i = 0
7 I" s2 P5 x# T% o& Z3 y   lbl = label
* |5 ^2 M' w. F8 n- W2 q* g   do - Z3 j9 ]1 ]: U8 {* f9 P8 ?
   if not dbg_Data.Exists(lbl) then exit do
9 B# ~/ ~7 |2 z8 w   i = i + 1
' \2 F/ Q1 z0 V  U$ P# s7 B; o   lbl = label &amp; "(" &amp; i &amp; ")" 7 z5 e: N" N* l* w. S
   loop until i = i
2 M5 @& G. d2 t( v% l: n  $ p, f+ u. x4 f! B) e
   ValidLabel = lbl / h& m& A* {9 Y7 P  i
End Function $ ]% i, O5 x* F1 }/ \6 c
  
" b! y: z8 P! g0 V" E/ w* d5 f& D) N- ['***********************************************************
  {* V9 \; u# {) Q) S'* PrintCookiesInfo 2 n! W3 J$ h' \3 c  p
'*********************************************************** ' _3 t4 P6 ~* Z
Private Sub PrintCookiesInfo(byval DivSetNo) ! p9 d1 U' y& G. o/ ^, S; U5 s2 X( ]
   dim tbl, cookie, key, tmp
! J7 P) i' G- S   For Each cookie in Request.Cookies 0 |2 G( R# v/ Z2 i& T, ^
   If Not Request.Cookies(cookie).HasKeys Then . B9 y6 ^& c% ?
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   $ e+ d5 E+ U' \
   Else ) I% T3 Q: j4 \4 J- T9 Z
     For Each key in Request.Cookies(cookie)
. K! ]1 s; ]  |) W8 D     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. & C4 a& O( y3 J) x, Q  _
Cookies(cookie)(key))   7 Z1 ~% L7 h3 g; I0 ?6 F
   Next 7 F1 O. b2 \3 @
   End If
' Q0 e2 e+ h& Z; B3 ^   Next </P>
) J. W8 k: w' {+ l<>   tbl = MakeTable(tbl) * X% y* @0 d8 v7 X) B
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
9 G' q, Y; ~+ g   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ' i3 x6 x9 G' g% H' P3 A
   Response.Write replace(tmp,"|", vbcrlf) 1 A" \1 b' ]3 H" M
end sub ) F) [( @- v! R# Y. g- {+ R5 E
  ; x+ @" ?$ Y- Q+ M( t* N. n2 F
'***********************************************************
1 l- Y  ]3 t$ h" G/ h'* PrintSummaryInfo
! \3 [  o. Z: Z) O/ N. F$ V'*********************************************************** ; ?2 o2 H8 ?, b) g* R& a7 ?8 [
Private Sub PrintSummaryInfo(byval DivSetNo)
0 o& |9 u7 N  q5 L5 h' C   dim tmp, tbl
3 G* f: b% o3 E5 q   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 0 H. W2 ^6 p2 ^
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") / I7 q7 l& v8 m5 s- o& [
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
( A) T$ `4 B& Z2 E/ H6 G8 ]3 c   tbl = AddRow(tbl, "Status Code",Response.Status) ' u( V9 _  P' z$ H* E
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 1 M, \# l. F, K% {
   tbl = MakeTable(tbl)
8 E( f$ i( Z: [' C: T) s   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
* b( F# e% S8 a5 v9 k$ d: m   Response.Write replace(tmp,"|", vbcrlf) * ~9 z  D! W4 L: T* s, X1 t, X
End Sub </P>3 G; K% Q3 J  k2 p
<>'***********************************************************
5 H8 w) y1 ~1 y5 S' w* P$ c''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
( H2 H4 c( l' @% o4 f. m''@PARAM:  - oSQLDB [object]: connection-object
) H* Z1 B& T; o'***********************************************************
7 Z8 z. R2 l( q& N7 ]+ xPublic Sub GrabDatabaseInfo(byval oSQLDB) 0 J5 J' ?& C: ~  W, a8 w* r3 Y
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
. a8 d6 }4 d# {7 h8 M7 L   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
4 |/ T5 K; N( @; z- f% D) c   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"))
& J( ?1 I& [6 ~1 T, ^% w& b6 w: U   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ' S7 T; }! J( u5 \4 p- q0 \, `
End Sub <>'***********************************************************   L$ O5 q# K( i/ w
'* PrintDatabaseInfo 0 W: V1 h; t4 s1 j5 J$ B1 [
'*********************************************************** 7 f/ x7 B! U3 E
Private Sub PrintDatabaseInfo(byval DivSetNo)
/ `$ Y8 ^4 W0 `3 C4 D4 E   dim tbl 4 D: K# A; e7 K3 ~4 |3 D( {
   tbl = MakeTable(dbg_DB_Data)
; B; I2 ^- p8 P" G* P+ o( ]   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
; q! k3 y# Z) U* N& i- u& M3 k2 m   Response.Write replace(tbl,"|", vbcrlf) - c6 j# t* Z3 ~' v8 i" l
End Sub </P><>'*********************************************************** + K6 r6 }# K# t% T( U
'* PrintCollection
$ P6 [* a3 O% ['*********************************************************** $ j' ]! Z$ h% Z
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + @, V  B3 [1 t: _0 W) q8 T  j" O
   Dim vItem, tbl, Temp
8 i# J3 O1 Y; t! }0 }) L$ b   For Each vItem In Collection / B3 u& k& g9 f6 F& P& V
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
$ C1 [9 P- \/ @6 Q, [( c6 w       tbl = AddRow(tbl, vItem, "{object}")
9 r& {; V% m# o' J) }     elseif isnull(Collection(vItem)) then
9 _) T, s7 M& N! f6 H8 s       tbl = AddRow(tbl, vItem, "{null}") 2 j) X% ?& E( ]9 ?6 V" f
     elseif isarray(Collection(vItem)) then
0 l" D7 z& {4 |# F9 Q       tbl = AddRow(tbl, vItem, "{array}")
' a# V; B0 x- i. t7 t, a# f     else . }( J0 }, P, g; l* n) p# L
       if dbg_AllVars then
- w: s$ p( |7 z; z) f       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 2 L7 ^# t  U) Q: {6 z0 ^
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 5 I* z. d3 Z$ g
       if Collection(vItem) &lt;&gt; "" then 4 y& o0 }4 O" i+ |: Y! L) v+ N+ t
       tbl = AddRow(tbl, vItem, server.HTML8 K, m8 C6 y7 t: z# |% G3 g
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") * F. t& Y9 p. ^% _, V
       else 6 ~/ ?* g0 S' h. j+ _* F$ X! \7 d: F- p
       tbl = AddRow(tbl, vItem, "...") ( g1 S: s) N2 n. ?. K" Z
       end if
' h* @9 j& M0 F! A: C, \4 ~     end if
0 B& h( i! S, U  P- w9 [. v4 E   end if / Q0 ~  o/ d/ k; u, S
   Next
$ J& U$ Z' Q' ]   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo - M$ Z2 X1 Z. v& R5 Q% C
   tbl = MakeTable(tbl) : n8 Z: I  X3 y- @6 l
   if Collection.count &lt;= 0 then DivSetNo =2
+ k( n* C( l/ K7 `8 `4 L6 U     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# @( x+ E5 h* f9 H     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 4 o# k3 w3 i1 j+ n: y$ h
     Response.Write replace(tbl,"|", vbcrlf) & ^3 c! \" K+ K: L5 v) I
End Sub , a0 r4 u8 u/ M+ O5 v
  % L/ R% m0 r8 q. u% p
'*********************************************************** + d' J7 ]/ y. p( [6 R
'* AddRow + n( P" ^: Q; X1 v% g2 ]% `2 b
'***********************************************************
% ^  v) F4 s/ c4 mPrivate Function AddRow(byval t, byval var, byval val)
# w( F7 G2 o- U1 U: V3 H   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ! M0 E7 z( s9 J* `( Z% d
   AddRow = t . r( t* [% X0 {7 M: ?: r. p# _: w, A' E
End Function </P><>'*********************************************************** : p# I$ o2 d1 S$ ^5 f! W4 o0 t
'* MakeTable
# ^% r) p& M+ y* P% j6 {'***********************************************************
7 X" b9 z0 Z  e' qPrivate Function MakeTable(byval tdata) : C3 X7 Q9 ]- s! c$ g; v
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" + p) j6 X6 r9 W  T1 M
   MakeTable = tdata ) x& ^. c. ]. v5 W8 N; P
End Function </P><>'***********************************************************
  J6 Q/ D, `3 H+ X6 T''@SDESCRIPTION: Draws the Debug-panel
. U9 x$ E7 c5 f5 A' P'*********************************************************** 2 C: }, x7 l2 d) D$ R
Public Sub draw() ! ?: K0 n" u0 a7 U  v3 _9 P
   If dbg_Enabled Then
$ |# V3 S# ^9 p% [     dbg_FinishTime = Now() 1 ?) ?( t, |/ [. F3 `
  3 I( C* l8 B2 l& E) u6 p! D
   Dim DivSet, x
( D) z4 J* n+ P' V5 L! u: @   DivSet = split(dbg_Show_default,",")
2 q7 j) `' E* H6 N& @8 L     dbg_Show = split(dbg_Show,",") 4 i0 M' Z- J  ^) K" C" s& _
  ( w2 B4 z3 e( e, J% i3 J- Z
   For x = 0 to ubound(dbg_Show) 4 d2 [1 Y8 S0 X4 M8 p
     divSet(x) = dbg_Show(x) " y# N# ~( c. O4 Q: h' N0 R/ W
   Next
, \( M5 I* O( ?* A) X2 H' W# {  
+ j! r! a! `0 ^- s/ q6 N   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;" + q3 q0 n; d0 j
   Call PrintSummaryInfo(divSet(0))
; {* W6 g5 U3 _" U% G5 {) Q# r0 ^- c     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")   a8 K  {  Q  C
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- o( z& a& D6 E    Call PrintCollection("FORM", Request.Form(),divSet(3),"") " ]% C, j1 g: L/ |1 Y
    Call PrintCookiesInfo(divSet(4)) ' E- E' {& _0 d
    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 a& d5 T5 |5 V/ j/ u" x) k
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") % C3 I9 Q* x! P0 L9 x7 u
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) , R+ w  c  Z3 N2 M
    Call PrintDatabaseInfo(divSet(8))
( [) ~& P2 Q8 {" r# |- d    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( T8 {: z: d- X: a  ^5 q' k    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
$ t3 m- P+ v& L! Q9 D    Response.Write "&lt;/Table&gt;"
' T, O3 o* R/ S& @! |) p& s2 t   End If 8 b/ ]5 W0 ]: D$ K- P% w
End Sub </P><>'Destructor
4 V' z, {$ f4 k' P" Q1 s+ ePrivate Sub Class_Terminate()
) w/ S  B5 x4 J; F9 S1 M) d   Set dbg_Data = Nothing 9 y: s* V, `8 y' C9 B5 b7 F
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
2 v+ \4 q% z. ^% J" f/ A! h1 VCLASS debuggingConsole ! W4 j6 N- O8 Z1 H- i# m* L3 M
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " J) n3 W0 l5 p0 c
&amp;n
! V& o; S* V$ N* x( k6 p- |" Tbsp; $ |8 f5 A0 O" A) o+ z; v
Property Get Enabled===[bool] Gets the "enabled" value . ^4 U0 z# B9 d8 n/ g
  
+ E8 j* ^5 G2 e1 g. Q: UProperty 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
3 ?; S0 T0 G0 F8 M  
1 c, p5 H( `$ V/ `: JProperty Get Show===[string] Gets the debugging panel. % F( i& [3 s" |, n8 l
  5 _& \, a7 X/ U! B/ v/ C* }' D
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><>-------------------------------------------------------------------------------- ) i3 |* ^6 z' y3 C3 B+ W! q
Public Methods </P><>public sub===Print (label, output) : L$ R- \# L- T& }/ X
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
1 [. o, R4 V9 M* x  `   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
7 C9 U* e5 e7 z5 {9 E9 ]   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 3 d. K0 G  w1 `' |; z2 V
Methods Detail
# D5 |5 q5 k6 u- Z* p  % _  k6 ]! V/ Y+ p# X1 [/ n/ ?6 n
public sub===Print (label, output) 9 T' G0 W% r. l, q5 _$ P
Parameters:  ) k3 |1 E7 K& H- f
   - label [string]: Description of the variable ! h) h& j" H7 E; W& B0 B4 w+ ]" ^
   - output [variable]: The variable itself % n  ?: c4 W" w6 Z6 p0 y* X( W: s
  
7 r! M; {1 }# Rpublic sub===GrabDatabaseInfo (byval oSQLDB) 3 \, f* X# M2 s. V3 J6 [* R
Parameters:  
# g6 n' W, F* ]$ i! 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-5-31 05:31 , Processed in 0.320054 second(s), 57 queries .

回顶部