QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>3 m+ O- Q- N0 @$ U
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! , J. [. ]3 _9 |3 k
使用方法很简单: ( b/ h! j% t9 Q# I
test.asp </P>5 m9 a) ^8 D7 F7 F* r4 j
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 8 {1 U7 B3 ?9 d4 `* r/ T
&lt;%
7 D: o3 i# b# Xoutput="XXXX"
: `% {* s9 X" O, I0 ^Set debugstr = New debuggingConsole
0 D  }- h' y% o& E- xdebugstr.Enabled = true
$ Y3 U) }  s# ~9 g6 W   debugstr.Print "参数output的值", output ) ]$ N% Z  g, A$ X
   '……
" G  G" E- P' H/ |0 }6 e   debugstr.draw 2 V( V7 n* ?9 j  t, n, n- d
Set debugstr = Nothing   B: r% `. ~( f1 E
%&gt; </P>
9 T8 @5 {6 ?( b& a" q& p! T<>=================================================== </P>  O5 R6 x8 K9 m* Z6 O
<>debuggingConsole.asp </P>+ T+ j/ a* m  \, Y+ T( k
<>&lt;%
8 i+ v  w; \' H0 x, u+ FClass debuggingConsole </P>' e/ k; Y5 ]/ X3 o
<>   private dbg_Enabled ! s, f9 [, c& D! O" h
   private dbg_Show 6 f# e1 x8 H3 }$ Y8 E
   private dbg_RequestTime
; y" n% G# v4 R8 X   private dbg_FinishTime
, x# W) }* U: W/ b% Q   private dbg_Data
: i* U4 r% q! }& S' l3 ]3 z0 O   private dbg_DB_Data . W$ k$ e4 h! l  c+ A! A
   private dbg_AllVars 6 a  I0 J' z* g
   private dbg_Show_default
# e/ x) v7 h( N0 B8 }9 j5 N   private DivSets(2) 3 Q, ^+ r/ O7 A# [: w- R
   
/ J9 O+ r* ]* E* l. V5 P5 Q! ]'Construktor =&gt; set the default values - r6 k6 S! i! ^
Private Sub Class_Initialize() " G5 E: s% F; B4 n. A! T
   dbg_RequestTime = Now()
& G$ [: H- p: t2 f   dbg_AllVars = false ! y. q. b3 B7 B' R, P# q8 G
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>; e; u! @% }! K) p2 c% C) d
<>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>
8 a, o" q, _- M0 _! }<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
  }$ \" ]. I4 Z6 b4 B/ s# 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>
* `$ ]9 O7 M3 q* x. N& J) [2 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>6 v9 E6 U" ^% p7 [4 X% W+ r
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" & [7 C8 O, p& n- q9 J
End Sub </P>0 Y) P9 H/ k, f, G4 S' v
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
# |, n1 f# \$ {   dbg_Enabled = bNewValue 6 k3 A5 M& c9 q& {, p% g
End Property </P>
1 W4 V" D9 ?2 k+ Z6 m. m3 L<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
! [) h! [- `3 I$ }   Enabled = dbg_Enabled
$ S* a6 a7 K/ q9 o. \6 x. k$ r5 oEnd Property </P>* ?/ J: f& U, u; ~: \
<>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
0 R2 _9 y( g& v" l   dbg_Show = bNewValue + I: V, G8 |* O
End Property </P>  S+ W8 V. W/ g, B( N7 B" s+ l
<>ublic Property Get Show ''[string] Gets the debugging panel. ' w7 ]% w+ Y8 K7 h. c* _% m+ c5 B
   Show = dbg_Show & J9 g: [. G' \. f  f
End Property </P>9 {1 z8 e5 T5 a. Q1 d
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
' X7 V6 R" B" _+ o2 {; X$ m) a   dbg_AllVars = bNewValue $ n* B, E0 a% M3 [/ U
End Property </P>
; i6 y' Q* p9 i( F$ @: {<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( u. v7 \: D9 c' M( @! o
   AllVars = dbg_AllVars 3 O9 I5 b! U& {, b- e! J6 Y5 y
End Property </P>
6 C! J8 F# D) D# @# [& L4 h. J# H' D<>'***********************************************************
5 V% }& W- B$ c''@SDESCRIPTION: Adds a variable to the debug-informations. ( ^& a6 o! _: [" _6 n
''@PARAM:  - label [string]: Description of the variable 3 E* [) _- N; C" f9 L! |
''@PARAM:  - output [variable]: The variable itself
' r& W, Z* M% p( U'*********************************************************** / }: }+ ^  r. V# q
Public Sub Print(label, output)
% }5 {! {9 u+ M: |" P) j! L" [   If dbg_Enabled Then ) P& k# h2 g$ Z; p1 s
     if err.number &gt; 0 then
. G5 L$ [. o% A/ Q. z# c; D       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 9 ]; G, ]6 F0 R* W$ O
       err.Clear 0 {+ A1 Y0 p: r& V
     else # T) n( H, E, E% u3 S
       uniqueID = ValidLabel(label)
6 B; h6 h  u; v3 k  ~       response.write uniqueID ; U5 Q; l/ V2 ?6 m0 _# a
       call dbg_Data.Add(uniqueID, output) % O! \( T4 A9 ~4 P* i+ U  f
     end if - w* k$ y6 E* f; N& `5 k
   End If
4 k- ^# @# \1 TEnd Sub
3 }* a/ b/ |. w. f  " }, H" `+ i+ p) D
'***********************************************************
& _" ^" @" w7 J4 Y8 N* M3 Y: o'* ValidLabel # ~+ Q5 S& n; T* i+ \
'***********************************************************
$ W- S+ X- w, i- DPrivate Function ValidLabel(byval label)
( Q2 f1 N+ `4 U4 h4 ~2 t   dim i, lbl
# o* g8 x5 x5 u) |) d' j: L& e9 E, m   i = 0 1 G$ P  Z8 m; {: B
   lbl = label
9 \: D$ x- O2 g& D6 u   do / g8 s( r/ g( k6 \
   if not dbg_Data.Exists(lbl) then exit do   u: T: F& K- u" o; W8 Y
   i = i + 1
% a) U/ H1 j9 k. n5 G   lbl = label &amp; "(" &amp; i &amp; ")"
* ?2 x  F* l* x- b3 j6 B   loop until i = i
. f" ^) [, Y3 }, K/ @  
* K# l, D, @- ]  C; [+ r/ F   ValidLabel = lbl 4 k! F0 a/ H4 s5 j
End Function 7 U+ g6 p# {* i8 V' g1 k' h
  
$ v8 k! [$ w9 D( J+ U2 m, Q$ w'*********************************************************** + F, z8 ^# Y. {
'* PrintCookiesInfo ; I2 t; s6 @  Z6 p" G5 K
'*********************************************************** % b, u( Z# i, `. K) h
Private Sub PrintCookiesInfo(byval DivSetNo) 3 t* u1 I& Z0 Q+ G
   dim tbl, cookie, key, tmp / t5 I3 ~& z3 H/ E( @- v
   For Each cookie in Request.Cookies / B4 q% s! j% I" R0 x
   If Not Request.Cookies(cookie).HasKeys Then
0 \8 n% j) ~! Q# m( y     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ M+ b6 M3 n5 @5 t! u   Else : k7 U3 a& f" |5 l+ @% M7 c
     For Each key in Request.Cookies(cookie) 2 ]! k1 e. G( I1 N$ A9 I
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
( z5 J( R% y5 w# t/ nCookies(cookie)(key))   
5 O' e7 O* Z8 ?# Q: t/ u   Next
9 d& z/ F7 A7 z& Z' D   End If ( I) v" O& F( V8 R
   Next </P>% C4 e2 H  _( Y; ^! h8 |
<>   tbl = MakeTable(tbl) 4 Y  T* f/ U/ E
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
8 o7 f0 `' u& d! T9 E) m4 K# v   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
9 J9 l) P3 I4 f: I( \+ i   Response.Write replace(tmp,"|", vbcrlf)
9 d: b* p0 i  l5 q, Kend sub
# R4 W6 |5 h. d- q2 o  
4 E8 y5 A3 F6 s& X: F1 F; W: D'***********************************************************
0 |4 ]5 K9 S( P'* PrintSummaryInfo - i0 i5 M# j2 h' @  H
'***********************************************************
# y1 j7 T* k1 I& q" LPrivate Sub PrintSummaryInfo(byval DivSetNo)
6 g1 ?) `7 i' Y& v   dim tmp, tbl . Z. b1 E8 k( L2 |2 {+ |! F
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 1 }5 x, A6 @# _& S- s" L
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
' x1 _7 e* e: w; s   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
* ?: S, P, z& ?# |6 t: `   tbl = AddRow(tbl, "Status Code",Response.Status)
+ C  e- T. C( T+ S' T2 b/ X   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) $ I/ w; b* s8 `  m, q
   tbl = MakeTable(tbl) 7 l; e+ p; s8 A+ w$ C
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
. Y" z4 q) r9 M3 h# p   Response.Write replace(tmp,"|", vbcrlf) 2 S/ S% n! F+ |. S' X% e2 n$ H
End Sub </P>, g5 ~# \* p9 [# D8 q
<>'*********************************************************** 5 _1 [5 B1 V/ m) i
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
/ W- r$ n- _: _8 Y+ {- e5 `. w''@PARAM:  - oSQLDB [object]: connection-object
: e6 k" D. j1 U, ?' O! g'***********************************************************
/ J' @) K" P7 F4 l0 qPublic Sub GrabDatabaseInfo(byval oSQLDB) 0 F* {3 C3 h0 f4 C$ ]9 a
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
: j5 G( k: K* T" \  W- Y3 m   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) + V4 W3 s' |7 j- B0 Z0 s2 O/ 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")) 8 N  [5 F2 z6 S5 A
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
# t& x* o$ I+ h" i$ q8 R) x2 b6 SEnd Sub <>'***********************************************************
; M! [2 a$ @5 [: s3 J5 u'* PrintDatabaseInfo 1 V6 i- J- s* |# k: L* e
'*********************************************************** 6 U) t; C- J! w; L
Private Sub PrintDatabaseInfo(byval DivSetNo)
1 \% g1 ^# p( C1 V& x2 i   dim tbl " c) ]: M0 v  |. T! l/ K
   tbl = MakeTable(dbg_DB_Data)
) \; ~; N2 t% l( @& j0 L3 V   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) * t2 k: U! }0 n0 p. U) A5 D
   Response.Write replace(tbl,"|", vbcrlf)
4 h7 N1 w4 @# [& N! N3 Z8 d+ UEnd Sub </P><>'***********************************************************
& r; ^7 ^. F( u; f1 I8 O; U6 W'* PrintCollection
+ d$ Z# Q: d3 Z. h+ d* }0 m'*********************************************************** 9 b1 Z5 ]/ g) b  R4 m
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; K: Z4 Q4 z& G
   Dim vItem, tbl, Temp 2 q. G. a1 ?& o4 `" V5 `0 k: \
   For Each vItem In Collection , S1 q; H" i& H7 v! i9 ?6 \7 D
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
3 _& b4 `, I, V7 V       tbl = AddRow(tbl, vItem, "{object}")
& i- k  i1 ^( c) [2 y     elseif isnull(Collection(vItem)) then
2 t, r0 ?4 ?, v       tbl = AddRow(tbl, vItem, "{null}") * ]( _0 s( F% J9 `
     elseif isarray(Collection(vItem)) then
2 o# G' |; W7 G9 A* g" f       tbl = AddRow(tbl, vItem, "{array}") ' C5 y( X- D8 t% a
     else
( _/ }' L# p' r) O' v) k4 i       if dbg_AllVars then
5 l! k/ H9 C6 m4 `4 A3 O- R       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
. O$ c7 `$ ^) y& E     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 2 E9 o: N2 S, r
       if Collection(vItem) &lt;&gt; "" then
  f4 c0 k( u$ P       tbl = AddRow(tbl, vItem, server.HTML
  W. M8 q& P$ e) ^# o8 _, uEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 6 u* ^- e: n& I( L. r6 F' d
       else " C- {( |2 ]. }$ }$ P# O9 Q# ^
       tbl = AddRow(tbl, vItem, "...")
8 `7 A4 L5 F) ^) K9 M0 ]       end if # x& B& h( I  u6 }4 E
     end if
, V. F3 _( e0 b, q; x4 k0 e   end if
" N6 D* e; v% e+ n, _   Next
* ~4 L0 K0 |' @5 v: Z7 }6 s5 b   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo * t2 f" R) P* D4 f! K* @& L
   tbl = MakeTable(tbl)
5 [) _! S3 W6 _" _   if Collection.count &lt;= 0 then DivSetNo =2
$ Z. ?9 m; |1 O     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
: T  e/ j- N1 J3 e: S5 ~! \1 x     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* R0 n+ Z; U* ?; @, x, x( d  y     Response.Write replace(tbl,"|", vbcrlf)
! {' x; G  ]. S  {: d9 ?5 w4 qEnd Sub
6 w+ r% H& V/ o! l) u, q  " U* s9 n7 d' H/ U! u) T
'*********************************************************** " |0 k1 E1 Y2 A: j; |  n* {1 [
'* AddRow
1 O( u& t  c8 ^. |- j'*********************************************************** ! b1 B7 Q- R' I" [9 K. P% [
Private Function AddRow(byval t, byval var, byval val) ' p' E' @. ?) s) Q" h0 P; ~5 x
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
1 h7 _3 \  `3 J* m: @/ n   AddRow = t 5 g! \( u: w1 f' A* J$ k. m
End Function </P><>'***********************************************************
5 n' N  A# e/ g8 v* S'* MakeTable 2 N. B7 q7 \: f4 a
'***********************************************************
+ X, y- I: R! L4 ~+ I& {Private Function MakeTable(byval tdata) 0 ~3 e9 s$ g4 D4 v* C  |
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
) @* `' M# n1 i/ m6 F   MakeTable = tdata 1 r' Q2 s8 q) S- {
End Function </P><>'***********************************************************
3 N1 ?/ z! p' r. n''@SDESCRIPTION: Draws the Debug-panel ) b# w; x( B+ o2 {$ @( ~- k
'***********************************************************
) O/ s8 o$ M. f, x$ WPublic Sub draw() : t7 {1 ?2 l( |
   If dbg_Enabled Then
3 K" c0 l2 A! V4 J     dbg_FinishTime = Now() , G7 T8 B7 k7 P( _1 x3 T, N, L
  
. m  L' b. I* e9 V  C- j2 Q, I+ S   Dim DivSet, x
* z' b) b( t4 P8 I6 d4 Z   DivSet = split(dbg_Show_default,",") 3 i, C, G% O2 k- I" [$ l
     dbg_Show = split(dbg_Show,",")
1 `* L$ x. O% R  
: }0 a& H; a' Y# g& P9 L   For x = 0 to ubound(dbg_Show) 1 [8 @  c0 j2 K/ I
     divSet(x) = dbg_Show(x) 3 k8 h) {. E8 a
   Next - p8 S: u' n1 J" j! \0 x2 ^
  
0 }0 @5 @2 v+ ~$ @1 l" u7 D. a   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;"
9 c; {2 L/ `  l   Call PrintSummaryInfo(divSet(0)) & a/ @* o8 V$ c1 ]  S
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
  l, H# k6 \/ a' ?3 ?/ n* _    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 z; Y9 U9 _' X5 }4 x    Call PrintCollection("FORM", Request.Form(),divSet(3),"") / i5 T. @# G& d
    Call PrintCookiesInfo(divSet(4)) + f8 z) K( C, g% s
    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))
5 Z, \$ V* q0 d  [! Z    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . c! p1 j7 `& B. D
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
) Q0 _, C3 Q3 S7 y. P9 T    Call PrintDatabaseInfo(divSet(8)) : |% N2 I1 D# r2 p1 C2 K4 `
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ' b! ?- V6 Z1 g+ p5 D% F2 Q, ^
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
. V/ w( t  ]9 t9 s    Response.Write "&lt;/Table&gt;" 0 @+ A% O7 \  l+ w
   End If
" D+ e1 F( f" E; v; J4 u" NEnd Sub </P><>'Destructor ) r' f  E2 O9 L: q# I& k: B1 @
Private Sub Class_Terminate() 2 e5 \$ o% x, q" }
   Set dbg_Data = Nothing 7 m$ \9 s9 I# n% D3 }8 E  @% Q& u
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>: O1 u: z) |5 V- d3 c- d( E3 M( o3 G8 `  Q
CLASS debuggingConsole
  n; ~$ x! x) @  r0 Q6 ?0 D9 k$ ?Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
# a& l; w' }5 }&amp;n* P& u9 l6 b$ r, S7 I& D
bsp;
' V, ^: q! S! Z4 LProperty Get Enabled===[bool] Gets the "enabled" value
0 h+ K+ v! k$ w7 X* O/ I' p" `  
; q( f4 N. F5 d4 t6 p% tProperty 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 h4 ?" L: Y! [1 A) Z4 @8 x: Y% M  / K( B( H2 k3 N( a
Property Get Show===[string] Gets the debugging panel. 2 k4 L8 \+ X' a& L3 ?$ C( L- X
  ( M( e2 h- |0 Y/ A& x* N
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 t) G9 d: P9 j% p2 j' b
Public Methods </P><>public sub===Print (label, output)
+ f7 u$ H8 ~" f/ o. O, E   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
  k3 p% w& ?/ m; `  t9 n( J" F   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
4 G+ G- L; v7 p% @! `   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
* B. o2 E0 N4 [; x. ?! a% |- Y9 uMethods Detail ' S$ U# d- Q; w8 ]6 f5 x3 p% F
  
7 q+ |1 G) I: U& opublic sub===Print (label, output) 4 c/ p' l* }; d* q) ^
Parameters:  6 I" Q7 O, k; m% N
   - label [string]: Description of the variable
( \; s# @% q% H7 |4 e3 _   - output [variable]: The variable itself & ?/ d% h% @# p2 S
  / F; L/ ]* u' c% f. T2 h. z" d
public sub===GrabDatabaseInfo (byval oSQLDB) ! w5 C) t0 O# n0 p9 k. B7 f" i; T
Parameters:  
$ x- ~$ @$ ?% T  A0 \% [   - 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-10-14 22:32 , Processed in 0.543150 second(s), 56 queries .

回顶部