QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>6 |2 }# [% C: G; ]
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 1 g% F7 H/ I- e! Q  E
使用方法很简单:
8 u: i; _3 Z1 `- j  j( n& Itest.asp </P>
3 }1 P1 Z& A# |8 ?4 C) I, w# t6 h<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
# q% w- e! ?# v* ?4 j( N& q/ O0 Q# q&lt;%
  {0 H$ A5 H. k7 r* ~output="XXXX" % S5 R2 \/ X. l: q% f6 D
Set debugstr = New debuggingConsole
1 Y; `3 ]- y/ Tdebugstr.Enabled = true # n  F0 @& \* f
   debugstr.Print "参数output的值", output
* @% m$ K, j# X0 O   '…… ! o' E+ k% D" r2 x) X, z1 ^! l/ M
   debugstr.draw ! v! m: R- U8 n8 H9 R7 L
Set debugstr = Nothing
. k+ W! ~2 k+ Q! F- B4 W%&gt; </P>  X: A' X& g( ^& h+ f% o( i4 n  p
<>=================================================== </P>! E6 [1 ^9 M- Y4 ^" q% r
<>debuggingConsole.asp </P>
. H. L. Y* D0 ~0 G2 }<>&lt;%
/ _2 Y( ]# O. B/ ]. I# LClass debuggingConsole </P>" T5 C3 X' g, l5 ^" ~' v
<>   private dbg_Enabled
4 T3 J4 [5 ?- p% |  c0 i- p/ z   private dbg_Show
% s# h! l* G' x9 E) y   private dbg_RequestTime ' P, p" }( @4 b& U; N
   private dbg_FinishTime
8 b' `8 |" ^. [$ a, S   private dbg_Data
  a; q1 c  t& v$ t6 H. p   private dbg_DB_Data + g, s8 [; b, t1 `
   private dbg_AllVars
2 l+ u- l: S9 s1 l& j2 P   private dbg_Show_default
; C! U# e+ w$ K8 c* M   private DivSets(2) * c& D  }6 B% j5 {$ C' |% w
   8 N- o/ |" l! q+ |+ i8 {$ c
'Construktor =&gt; set the default values / g7 i  d0 W& W. ~5 v- V% Y
Private Sub Class_Initialize() - g. u* y6 P% G$ y
   dbg_RequestTime = Now() * |# w7 ~% A! ~2 u# w; o9 D
   dbg_AllVars = false
6 H- z+ n/ ]; f% L( M! M$ f# I( O   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>6 X" y% C2 |9 N- |& d: s
<>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>
  x( O8 |! i' I# e2 e# S/ h: A  c<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
. R" g7 }2 K/ a' X7 M7 _&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>
" c, X( s* o7 u: C% O- }! 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>
9 u- t& q+ }. l8 E0 K( X<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
/ X5 e. ?5 F- v6 P) x4 \# lEnd Sub </P>
9 x6 k' m# h+ ~: _2 Y<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
# r$ e# D7 Q$ h   dbg_Enabled = bNewValue # N2 g! \8 f: P. P
End Property </P>
- [+ g$ t, n* {<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
5 V" y* {( s8 C# T1 [% z# M4 y# P/ O   Enabled = dbg_Enabled
6 X  l) W7 M3 `9 p5 g7 \# k) QEnd Property </P>2 ]% j$ [( C& _- F5 y& W1 J9 C8 w
<>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
. ~& H6 _- w  b$ c   dbg_Show = bNewValue
% d1 S; e2 x2 {. _; BEnd Property </P>
$ e6 Z8 }+ a8 j5 i( x3 b<>ublic Property Get Show ''[string] Gets the debugging panel. 2 O6 o. O' n% z7 a2 T8 h
   Show = dbg_Show
2 `" N  K  Q. H! P: _End Property </P>
* c1 B* W+ ~5 t" ]7 P+ b( j<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
: t$ Q2 x2 _8 X6 P' R/ B6 x   dbg_AllVars = bNewValue : j- b$ y) a! X4 D$ ]
End Property </P>6 s, q9 X/ W; s4 d6 ^: W  R
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
+ [5 o6 f1 m6 N) W   AllVars = dbg_AllVars
3 m2 I3 H# L8 l# f6 {  qEnd Property </P>  c* G/ `) b$ g8 n) F& X. a0 d+ d
<>'*********************************************************** - i% r" F, r0 h8 M4 W
''@SDESCRIPTION: Adds a variable to the debug-informations. " g& Z0 C$ e' y1 A: o( I# D+ U& D+ T! C
''@PARAM:  - label [string]: Description of the variable 0 F( `6 N- o: L# r( S9 u0 |! a, O2 c
''@PARAM:  - output [variable]: The variable itself
: X( ~' m9 J* Q'*********************************************************** : u! T: t( g& G/ K5 B
Public Sub Print(label, output)
* i% A, `, a" V- p1 f   If dbg_Enabled Then + \3 x$ L4 u  ^5 X: C* Y/ n& y; c
     if err.number &gt; 0 then
4 I: |) H+ g( x       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
% ~' n. D/ |1 y! h8 |* w5 L       err.Clear
$ o) g4 _- n& ?; r; S     else
: H$ n! [" q4 c" Z$ ^" k, f       uniqueID = ValidLabel(label) 9 ]1 S6 }" R* e* n
       response.write uniqueID % z8 Y1 S" j/ O; X% W9 s! r
       call dbg_Data.Add(uniqueID, output) # E2 t3 U( [) s# F: q( M6 d( s
     end if ( A7 d5 U. }3 f, `! [9 T( P( P
   End If " P2 j+ y- ?# y7 Q
End Sub ! D6 x: r/ b% B% ]9 t
    {7 l/ B* {( H+ `# i+ I. ]; D
'*********************************************************** ; U( h0 k# A$ v
'* ValidLabel
' t, v2 ?/ }2 C& W'*********************************************************** , q. A+ `& h/ Y) b6 H
Private Function ValidLabel(byval label) # ~+ L6 |9 z% V: b* u: l% ]3 ^7 {
   dim i, lbl
% ^  _/ J8 ~: ~  l   i = 0
+ U: k: l( J! }! h. G   lbl = label
& M, b. M( ?, P$ w5 y- T* C  J   do
# j' c) s* R0 |/ c( f6 V' S3 O   if not dbg_Data.Exists(lbl) then exit do
3 l' v% Q& L: Q4 q6 U  p3 R   i = i + 1 3 }3 T. u* j1 T& J: v
   lbl = label &amp; "(" &amp; i &amp; ")" + s4 W9 E- t! {+ l% i* @
   loop until i = i
2 d* k; W8 Z% e8 W$ K4 p  
1 ^1 O* O! e( ^5 F9 q: V& [6 v   ValidLabel = lbl
4 {; M1 ^8 f  ^$ A# ^% Q( y& jEnd Function $ P8 n' k3 R: i
  
- q* w1 |/ w% l% J  y, C+ M- D'***********************************************************
1 O6 {5 r, U7 U! C7 Q'* PrintCookiesInfo
: ?9 F4 u3 F5 ^- f" P$ y9 e$ f'***********************************************************
* w/ `% j) Y6 kPrivate Sub PrintCookiesInfo(byval DivSetNo)
* V! ?3 z8 e& e: l1 F   dim tbl, cookie, key, tmp
1 ^$ l! X6 t/ R( V9 W7 U" o   For Each cookie in Request.Cookies
7 B; d& }# W$ ^8 m% u' l   If Not Request.Cookies(cookie).HasKeys Then 1 i( b* ~6 O+ m) N+ z9 V) J* Q
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ( }. E) f0 l5 B& ?7 K2 b: O6 Q% {5 o
   Else
8 @  N* c( v; P$ J0 f     For Each key in Request.Cookies(cookie)
, G& [, o: D9 k, Q* ^) a' [     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
3 M4 ]: N; \/ Y1 Y( E7 |% C3 ^Cookies(cookie)(key))   . ^) o, |( O8 ]0 O' j
   Next
# W1 k2 g' u/ r3 r. v   End If
1 h& T8 A! V" g4 S5 M4 O   Next </P>) ]2 B' D, F4 |
<>   tbl = MakeTable(tbl) 6 x( I: |: q4 D
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
3 m; v/ ?: `  W( M; ^8 R: r   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
" w! ]1 I. {6 y+ R4 p   Response.Write replace(tmp,"|", vbcrlf) " D" @4 g/ c% A
end sub
  _! B$ B4 z$ ]$ C  
+ }# y0 ]: E' x/ K'***********************************************************
% A2 l* a1 v7 h'* PrintSummaryInfo + J8 W2 X9 ]" ~7 F
'*********************************************************** - P5 G& b) c7 O: V0 ^* O0 Y( f* r
Private Sub PrintSummaryInfo(byval DivSetNo)
0 I4 u8 K) |, b5 |   dim tmp, tbl
+ _$ W6 R0 w0 n& m* x" g   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
6 a5 V- i. ^; x( S5 C   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 7 S0 e: C7 J9 c) l3 t
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) : U7 U# m' b# [7 p# o6 I) C
   tbl = AddRow(tbl, "Status Code",Response.Status)
  k+ f9 ]% ^1 H" m& |1 \4 o   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ! j) N+ [5 N6 I0 r4 E7 M
   tbl = MakeTable(tbl) ' n; |' f3 ^1 U6 I- {8 ?( T
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ( ~' D( F4 A; i0 Q$ d+ v+ q. h
   Response.Write replace(tmp,"|", vbcrlf) - R* f! x: @. t+ ~( a/ Z
End Sub </P>0 U9 i. `' H9 p  P
<>'*********************************************************** 9 [4 A, {2 p- K, B7 m/ P7 s% k: C% F
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
$ O6 n, e: n1 m9 b  `, q; x# z% m1 c''@PARAM:  - oSQLDB [object]: connection-object + W, k/ `7 }( J  P! I- B% V5 }
'***********************************************************
2 [! I0 y& I2 k4 ?5 Z9 m+ wPublic Sub GrabDatabaseInfo(byval oSQLDB) 1 b" l; g4 I! B, x' Y4 |
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) , W# _) x( [2 {- Z3 d) }3 w
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 0 W6 r, S4 U5 Z' W, T
   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 f" U7 d+ @: Q/ i5 y- z
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
" ^; r, P$ s* e6 ~0 N  \& s. GEnd Sub <>'*********************************************************** - q# R# D* d( b( ]+ Q
'* PrintDatabaseInfo ( Z2 T; J& u" w/ D7 s
'***********************************************************
1 h: m, K8 }- i; BPrivate Sub PrintDatabaseInfo(byval DivSetNo)
8 [. @, Q" \1 ]) f5 r/ H  s   dim tbl 6 q" U6 R7 G# S% m% Z
   tbl = MakeTable(dbg_DB_Data)
8 U; N/ [9 y# D6 Y( g   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 9 C& a/ I3 N5 [1 I3 `3 O' z6 n. L; K
   Response.Write replace(tbl,"|", vbcrlf) ( m1 m3 O1 ~( w  P, g" E3 s, }; c; c
End Sub </P><>'*********************************************************** ) x" _* z  v1 I% u' a  y7 i
'* PrintCollection
$ ^8 p4 g' A9 K5 T'*********************************************************** & h$ M6 y; k# _! u& g
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
1 p- V3 y4 _6 q& J   Dim vItem, tbl, Temp " d' G% o7 ?+ L3 }) U, V( f$ ?
   For Each vItem In Collection
) l2 V: }5 Q- t% I1 R* u     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then : n) D. E; K7 z" f( k7 t9 }
       tbl = AddRow(tbl, vItem, "{object}") 7 ?$ @0 ^) t) ~& k5 y! A
     elseif isnull(Collection(vItem)) then ' I1 ~4 Z; p6 |, ^( l4 v8 K4 u& e: w
       tbl = AddRow(tbl, vItem, "{null}")
; I. o3 u% F* V9 h4 N2 D6 Q7 J/ c) |     elseif isarray(Collection(vItem)) then : A* z. F+ j; O% R/ r+ L* v+ L
       tbl = AddRow(tbl, vItem, "{array}")
/ B( E  p, C* G1 U% Q$ p5 d) Y     else
* b7 h. q( ^6 @0 X* }       if dbg_AllVars then + t* f4 F# t! g8 W
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
2 }0 b  F; q9 q! m" D( o     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
& V0 e; H+ }) T: Z! J7 z       if Collection(vItem) &lt;&gt; "" then
% f( w- h. X: C* A/ ~       tbl = AddRow(tbl, vItem, server.HTML5 G# B% V6 U. Y$ F
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
, L2 D; c/ {/ q       else
" a& T' }6 q. e) y/ O, ?       tbl = AddRow(tbl, vItem, "...")
; ^2 D% y, K) G- U5 G& j       end if
1 [1 B/ L. b) y     end if
3 X  j" O7 \+ n3 ?+ u+ d   end if
% _$ U, S+ v" r! k# A   Next
0 k6 F# M! x% A. f( f6 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
2 E9 C! b' R% Y7 Y" z$ f   tbl = MakeTable(tbl) ) N6 ]; M2 [! T8 a- v& `
   if Collection.count &lt;= 0 then DivSetNo =2 5 W6 z9 F, b3 _# v; ?/ O; o
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) $ U! G# b% Q2 G0 L% S* R* @
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) * W3 [, [- m& ^% b6 Q/ i
     Response.Write replace(tbl,"|", vbcrlf)
9 m: Q* F* o% O1 D8 }8 VEnd Sub ) ~8 `5 Q; Q9 g
  
4 v7 W7 p4 `& L$ T2 q! Y- ]'***********************************************************
" u" e$ ^6 D9 B$ f6 Z! k5 b7 ]'* AddRow , z2 _5 V  i" H: p/ m
'***********************************************************
9 k8 P& v$ q4 ^- d1 b' gPrivate Function AddRow(byval t, byval var, byval val)
3 P9 I0 f) Q& O9 }) m# w" c   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
: ^; G6 h' t" B9 D' g0 x2 l- b   AddRow = t ! W, j5 u1 T8 A
End Function </P><>'*********************************************************** % c6 R( I* H4 u* G; T" w$ F- ^8 L
'* MakeTable
6 v- h8 |5 t0 D9 z9 P9 |'***********************************************************
  j- D: M) G- [( W* aPrivate Function MakeTable(byval tdata) 4 L. F; u7 q+ q# Z% J2 H* Q
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ! S1 l" c( r) q0 O! C2 A
   MakeTable = tdata
" ~+ d! A8 c; p3 K" q8 nEnd Function </P><>'*********************************************************** & m6 n* ^! i- T/ N3 U5 P+ j7 k0 Z: ^
''@SDESCRIPTION: Draws the Debug-panel
9 D" _8 o! `2 F6 X'*********************************************************** 7 Q1 F" |: h, g: V- i. k4 g
Public Sub draw()
* O. G& F) K9 Y# y& S" I, y   If dbg_Enabled Then # L* t& q" P# @- x- \9 D% y
     dbg_FinishTime = Now()
8 L" Q+ [( O+ S; G  * ^/ b8 ?3 J! m1 _6 O  V" A
   Dim DivSet, x
: R& @# F. @  z4 n& p8 s  u   DivSet = split(dbg_Show_default,",") 4 F$ U4 s+ @) N
     dbg_Show = split(dbg_Show,",")
6 {; {3 e6 O+ b4 }6 [  * O9 T- N- N$ C8 v) o
   For x = 0 to ubound(dbg_Show)
2 w& w2 x* T- E  S     divSet(x) = dbg_Show(x)
4 J5 O% V! I+ `, O3 Y   Next
1 x. H' r2 k2 m8 n7 z  ; I0 ^: |) a/ e5 v9 F5 ?2 Q& L
   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;" 6 y% P* F& O& \3 U' G# d
   Call PrintSummaryInfo(divSet(0)) 8 z6 [6 k6 m; q# o
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 b3 c2 @! ^0 r$ W9 d
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( u+ ?& I% m% x. G9 {' Y, a
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
* b  I8 X8 j' N    Call PrintCookiesInfo(divSet(4)) 5 K) ?- ~. A# G1 {3 b
    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)) + ^9 Q+ N1 a) N( Y
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") / `( a' Y# o3 p0 U( i
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
" ?4 o; F! I4 ~2 T* M! f/ B# w+ X    Call PrintDatabaseInfo(divSet(8)) 2 w* a. t4 t9 N: M
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : I1 O. j! G/ M
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
1 T- j& J' W" [    Response.Write "&lt;/Table&gt;" 4 b* D8 x. U! A9 \- L7 g
   End If 7 G" Q' T! H) _& D9 c
End Sub </P><>'Destructor
; x6 j3 T( t: H9 l: cPrivate Sub Class_Terminate()
, o/ m& f8 G' z( I2 Z0 y' j) E3 V   Set dbg_Data = Nothing . L, h3 `' F" M1 {  |# c. `
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>; R' q5 {1 e. z* T' z9 Z0 N  v
CLASS debuggingConsole
5 M. V' ~6 @4 wVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false + i, s& f. Z0 T
&amp;n* w% i. c# X# U
bsp;
: _! B. }. T/ [; x& P- aProperty Get Enabled===[bool] Gets the "enabled" value ' a1 x* N! {* A( i# }+ ~" i
  ' S3 }% r, P$ h& G" h
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 % @# X6 \1 y7 \. n1 i1 V) z, y
  : e0 W! A/ c$ Y: U1 J# X4 L
Property Get Show===[string] Gets the debugging panel. ; o% d, j2 ]' l4 N1 X# b3 A
  3 n" m  w/ t' o3 x2 q) g& E
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><>-------------------------------------------------------------------------------- : R" E, m5 ]* V( U' h) t
Public Methods </P><>public sub===Print (label, output) 0 k" b3 y5 U' U
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 0 F0 y# t* h# D* E6 C$ \  Z  ^
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () " d! Q; _% @/ P" K. f
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- / }: B( b& s9 I; L. v
Methods Detail
" H( l% X! e+ A, M2 L  / |; w1 K* U4 c5 l. l
public sub===Print (label, output) 3 f# I& F1 h" f4 u6 Y
Parameters:  " ?. L% y( K/ N
   - label [string]: Description of the variable + T% [% v7 i+ x* j
   - output [variable]: The variable itself
0 x. H, L$ J: }5 c7 i$ B  # D0 c2 I6 F# U$ X
public sub===GrabDatabaseInfo (byval oSQLDB) 2 s! f% h, }  N" _# y0 u# |
Parameters:  
. X; U. `1 t8 c# Q, \* {   - 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-1-12 01:00 , Processed in 0.512322 second(s), 56 queries .

回顶部