QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
# z( i3 H! A( H+ }4 M<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ) }4 I7 ?7 p2 S* T* R
使用方法很简单:
0 O, K7 x) o& q) b7 Y1 Ctest.asp </P>; w* r( a! k: T) W' t
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; ) G* a9 N; ^. l
&lt;% 3 Y) A$ {/ b! [5 t$ m
output="XXXX"
+ f- A: X$ _0 ~; JSet debugstr = New debuggingConsole $ }  m, r' G0 Q6 d
debugstr.Enabled = true
+ O, X( Q5 s/ Q  x   debugstr.Print "参数output的值", output
2 B- |5 }5 F+ h4 ^9 e   '…… ; e1 D4 H) v% ^" N2 L
   debugstr.draw # X- Y0 s6 F% w  B
Set debugstr = Nothing ! g" F/ X9 K+ W& H
%&gt; </P>( C  w7 N/ P, u3 s! A
<>=================================================== </P>
! G1 `4 S7 R0 H$ F<>debuggingConsole.asp </P>
$ ]$ L. l% ~% D1 v, ?9 A<>&lt;%
+ I; G2 r2 n% mClass debuggingConsole </P>
$ m% x4 a& m' A' l$ Q- c<>   private dbg_Enabled 1 F) x7 c. ?4 v$ f% z
   private dbg_Show % Z5 X" m6 [, h- z- \9 c" ?
   private dbg_RequestTime / @/ c! a3 V6 ~2 o" a
   private dbg_FinishTime
8 _! Z7 Y' {& y9 c   private dbg_Data ; |0 a; l0 `1 P$ G5 y0 i0 d
   private dbg_DB_Data " j) M. x' ^7 V! L2 ?! R3 V
   private dbg_AllVars 8 S3 S# {* u# ^
   private dbg_Show_default
6 l( C5 ]) A& _& |2 ]1 Q1 b   private DivSets(2) # P6 v) h. Y! ~  d) m4 M
   
5 J# z' P8 {5 g, x* b- R) R'Construktor =&gt; set the default values & L6 F9 j* @; d4 ^  Q
Private Sub Class_Initialize()
9 d& w' \- n& M" u) m   dbg_RequestTime = Now()
, H0 w1 z4 [1 q* Y4 v   dbg_AllVars = false
: ~$ B; g- }# ?   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>& Q2 {% Y3 l# a' K" O' L
<>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>
+ E0 |) @: g7 N7 k<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
* D  W& D7 m* K/ p3 F. z&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>
$ V  H) K+ p7 ~/ x: i<>   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>
5 B: \* b9 S' R" b3 y<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" $ X. \6 q/ y( M, y
End Sub </P>8 b) A! @' m( D  r/ }, O
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ! W5 P: A( z7 \/ K( y# l
   dbg_Enabled = bNewValue 5 n5 F4 Y  \( q) |3 I6 ~
End Property </P>
+ m! _$ K, U  W<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
9 G0 ~* _8 _& {, i) B2 ~' W   Enabled = dbg_Enabled
- x3 L' G9 [6 ^8 {: sEnd Property </P>
1 W# {1 F7 L" _- p; a<>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
4 ]7 X' _2 j, z  u1 k- r* a* T   dbg_Show = bNewValue ; l& H+ ^: O/ D6 t' \: M. {/ e
End Property </P>  i/ P: l2 }3 k1 c) Q" U- J
<>ublic Property Get Show ''[string] Gets the debugging panel.
9 K1 F4 s  R  y: G  E# t, V& f   Show = dbg_Show
# F( a' v2 M" `. T- P: |$ ?* u2 A* _9 hEnd Property </P>
, z  P. U1 ~) }$ n; c5 [8 ?<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
  p7 t8 P+ \1 f7 x2 }" N% h; d   dbg_AllVars = bNewValue
! z. B( H6 r. wEnd Property </P>
' n" s8 g' C  M' I5 o7 s+ }8 e<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. * `" U' c# I. `; d- N. v) k) r" [( C
   AllVars = dbg_AllVars 7 ^( L6 I) [4 V9 u0 }& n$ \7 ^6 k: F
End Property </P>% h+ u! Z" A- K6 N- B
<>'*********************************************************** " O6 M( d: D8 w1 ^
''@SDESCRIPTION: Adds a variable to the debug-informations. 4 E7 f4 c4 O: F8 [- F+ a
''@PARAM:  - label [string]: Description of the variable 6 [9 b, w5 b, O7 r
''@PARAM:  - output [variable]: The variable itself 5 O' w7 s+ w% a7 {
'***********************************************************
7 j  q, e, e$ ^/ j/ DPublic Sub Print(label, output) 0 \, X4 j3 X1 A. ~9 X0 S
   If dbg_Enabled Then # G  f5 r, |/ N$ P5 n6 C2 ~
     if err.number &gt; 0 then . p  Q/ ~! M3 e6 N  C% |
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
3 C) J/ ^8 \" r- e$ d       err.Clear 6 @! \9 ?  X& j$ L
     else
2 B8 a3 n4 v: X       uniqueID = ValidLabel(label) % t: o6 f% I1 O4 K
       response.write uniqueID
1 ^5 E  D  V  g4 M  @  e       call dbg_Data.Add(uniqueID, output)
6 u) K. P/ w8 z' q     end if ( H; G8 p: i* ]6 c2 l
   End If 8 X2 W% J4 ~: B! o  k
End Sub
3 a$ J) x* W7 R# p4 ]  
) t) q9 ]  R) ~* |& A'*********************************************************** . m. I8 S+ w9 ]/ }6 k& H& D
'* ValidLabel . t5 S/ ^2 ^; g1 K' i1 _! q* ]
'***********************************************************
2 `- a& D4 O; e% Y9 o+ Z, JPrivate Function ValidLabel(byval label) : {. M; f) V1 U  y! |
   dim i, lbl
0 t( F1 v& f3 l$ h" v4 k   i = 0
. J. X0 r/ e7 V   lbl = label - ^, T( b  E, z, v
   do ) y  C& `" M2 H0 s& D
   if not dbg_Data.Exists(lbl) then exit do
" }( H5 o% n7 w/ h) F' y+ j   i = i + 1 8 O  T5 h2 j4 u! f4 G$ j+ h& L
   lbl = label &amp; "(" &amp; i &amp; ")"
2 g6 P* K( x# Q: `9 ?/ N   loop until i = i
# u) C+ @: {9 z: H- W, W  
' ~2 d2 n2 j$ B! G0 v6 w   ValidLabel = lbl
& ]3 I. I2 t: g8 `5 YEnd Function 5 _+ |# u% x2 V. z
  
  \5 a1 S6 x6 s, i3 i, w'*********************************************************** * z- G& \1 H  T' b9 w
'* PrintCookiesInfo
0 E$ ]1 n* f$ ~" \1 w& x'***********************************************************
7 N2 k! ^/ C! {Private Sub PrintCookiesInfo(byval DivSetNo) 3 ~0 t2 Z9 h! s% K* q
   dim tbl, cookie, key, tmp
( }( d+ J& f" M  g/ a5 `   For Each cookie in Request.Cookies
8 V# r9 z1 @9 q5 \   If Not Request.Cookies(cookie).HasKeys Then
. d2 S4 w1 X1 F" W2 L" V* n/ S# b     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   0 e/ v# w0 C2 D- Z
   Else 9 {  g- j) i: [5 Q" V1 n) g+ ]
     For Each key in Request.Cookies(cookie)
' {+ s; L! w9 A/ d7 _     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. " ]& u" H; A6 _- `- t5 F2 l& `
Cookies(cookie)(key))   
; Z9 ?# y9 C- k1 q! D   Next
3 s8 _- j! S3 ?   End If - x9 F& t  i6 C$ j. ?
   Next </P>: v4 L2 o5 `' H0 O8 K& D- m
<>   tbl = MakeTable(tbl)
! H- Q2 R+ f# J9 U7 B   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 3 _0 @1 `. D+ m$ K2 \; l
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ) T) s! E* |& i; N# {; R
   Response.Write replace(tmp,"|", vbcrlf)
( v- E8 y4 t* f- _# Cend sub : j9 a3 J5 X6 ?' X' a
  
, I$ p) I! v/ N'***********************************************************
: c, W7 a, v' x: X( v8 V% U5 r1 v'* PrintSummaryInfo * ^7 B5 Y& `; [' Y
'***********************************************************
0 K& h6 \* Z" `6 q2 kPrivate Sub PrintSummaryInfo(byval DivSetNo) 4 H- c5 W8 B9 }: M
   dim tmp, tbl % d( b3 o1 y( g$ K. U
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) % q. e7 H9 ?6 K. z! X) p5 m
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
4 {1 l. z* Z+ C9 L8 r0 O- T   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
3 q, e8 h/ B$ q   tbl = AddRow(tbl, "Status Code",Response.Status)
& Z4 V' `9 u9 e. o# {   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
! q. t* H3 R! Y6 }' K   tbl = MakeTable(tbl)
9 s3 m4 @; i  g+ @8 ], @   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ) _- c: |3 x3 M1 [
   Response.Write replace(tmp,"|", vbcrlf) 3 }1 H2 v+ u3 @5 g
End Sub </P>
6 u* p7 Q2 K5 T+ b6 o9 w5 w<>'*********************************************************** ! x8 j+ }8 }# k7 Q
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
) H# g6 j/ y- J3 {9 i) i''@PARAM:  - oSQLDB [object]: connection-object + w; G8 H$ W, C6 i
'***********************************************************
3 }2 V% F' {' r% k% L4 `7 }. MPublic Sub GrabDatabaseInfo(byval oSQLDB) 6 m) \. U8 u* `# M% ^
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 3 U" y6 i5 B8 M/ s
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
4 ?! P; }2 }& O" K4 @0 P8 f9 F   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")) % |: _/ s5 V4 U4 ~- P" W2 w
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) / w- H1 j# H2 J; m
End Sub <>'*********************************************************** ( O& X! e$ t- a# H& q2 g1 F
'* PrintDatabaseInfo
0 r9 v& _: E5 k5 _4 v& o( ['***********************************************************
! ?1 F) o3 X2 w# SPrivate Sub PrintDatabaseInfo(byval DivSetNo) 3 E: c8 q) x+ {2 w5 U
   dim tbl + F3 [3 P: _* [3 @5 E# ~/ v* E
   tbl = MakeTable(dbg_DB_Data) 3 F- U' v& E$ i, C0 n
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 7 k7 F* s5 T, W
   Response.Write replace(tbl,"|", vbcrlf)
: J: O- V4 Z. U  |End Sub </P><>'*********************************************************** " y, M+ r: \. m' f9 V
'* PrintCollection
5 o) _7 F" b/ Z$ [- t* y" {" S8 d: A'***********************************************************
2 c* L+ z6 c8 s9 d1 c% YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
1 K( c7 ]7 W4 ]5 q- O   Dim vItem, tbl, Temp 3 x% G$ T3 C4 |0 E4 C, c
   For Each vItem In Collection 8 H: B; [9 Q8 [
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ( O/ v% B* C$ t4 T9 H
       tbl = AddRow(tbl, vItem, "{object}")
3 B- L: |9 C$ L: r     elseif isnull(Collection(vItem)) then ) m" P! G4 {( _4 v
       tbl = AddRow(tbl, vItem, "{null}")
, M; w8 f  s. o! N0 }0 B     elseif isarray(Collection(vItem)) then
6 Y/ p" P( `* g       tbl = AddRow(tbl, vItem, "{array}") ' h3 ]' N0 F; o) H/ y: I# G
     else . f. E4 c% A3 O4 G$ L/ m
       if dbg_AllVars then
! c; E0 g% n/ s1 u- V       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) : F+ ~# g, j( s0 y
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
7 K4 @1 M4 k4 [  d2 O* O       if Collection(vItem) &lt;&gt; "" then
! G! i) O( G1 k' C       tbl = AddRow(tbl, vItem, server.HTML
4 H9 F& f; ~; {4 B9 qEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 5 p& m4 l$ Z1 c; Q) u+ H- i# `
       else + x1 d% V) ^% _0 O+ b/ t
       tbl = AddRow(tbl, vItem, "...")
2 Y5 [% _, \3 y3 ?8 z       end if
" n( o9 }5 k% p5 T     end if
1 v. [- ?4 i2 a' p+ F' V   end if   y# k3 X* m& h1 Z+ p* S! }
   Next
' g' R/ F+ @, v$ J* k   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo # r& B# V1 O+ j9 j3 Y) W. k
   tbl = MakeTable(tbl)   ?$ l* Y) \# ~' x' |
   if Collection.count &lt;= 0 then DivSetNo =2
; y6 Z5 V8 \/ ?0 [' A8 v, d     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
6 _+ ^' S% w0 H' x     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ z: g$ o+ p* ~     Response.Write replace(tbl,"|", vbcrlf) ) U, L# K& d0 o# x
End Sub , }! [4 d0 [& c( }1 S7 c* t2 G  j' `
  ( s  R* e% C+ W' D
'***********************************************************
- G  d5 J; Y$ t- ?'* AddRow
8 r. A1 B7 d8 b2 V'***********************************************************
% K& E1 ?. @- l$ o+ KPrivate Function AddRow(byval t, byval var, byval val) & G. e  d  t- a# T! R; W
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" - ^1 `0 Q6 x) |2 b& B  w
   AddRow = t
; t2 J( S) |, N+ g! }& ]End Function </P><>'*********************************************************** ' \( Y& G7 Y4 ^+ }0 A
'* MakeTable 1 ]( P) G$ r5 {; Q. S$ W
'***********************************************************   \( w0 E3 w$ ~
Private Function MakeTable(byval tdata) 5 r+ W$ s5 I) A9 v
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" + {$ I& z6 |0 H
   MakeTable = tdata 3 J) ]" ~1 r8 x
End Function </P><>'***********************************************************
# Q7 C1 F0 ]) X0 \- z3 ]4 G''@SDESCRIPTION: Draws the Debug-panel 9 c8 P3 h0 a* M% g9 S! z4 ]
'***********************************************************
! G- e( y7 |  i% g8 \Public Sub draw()
  R: O6 K: p# b* ?  x5 q& T) u! q   If dbg_Enabled Then
3 L6 T6 ?+ k* p0 C9 c1 V: M& O5 B+ F     dbg_FinishTime = Now()   ?$ Z/ Q9 X% `/ s
  
* B4 d% t* f$ T. r5 V# t/ m   Dim DivSet, x
% R3 t8 U$ V9 e3 u( Y3 O: p   DivSet = split(dbg_Show_default,",") 8 p# X. N4 r; J- }( y, L
     dbg_Show = split(dbg_Show,",")   p0 N: d7 H3 U1 P7 _
  
5 J1 {9 G( l- Y8 J' l# f0 M3 ]   For x = 0 to ubound(dbg_Show)
7 k! ]$ P: B/ e' h     divSet(x) = dbg_Show(x)
7 v: ?2 K6 V* w. J2 V7 {" \   Next + |" U/ A( E  H
  " J: c, J$ {" Y6 M4 z
   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;" ! j9 f* u' Z/ J6 ~7 O, `
   Call PrintSummaryInfo(divSet(0)) 3 Q8 e0 o7 B2 V4 Z; r( Z- _1 y
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: T& L% p& q8 p( Q% {    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") % x2 q: V2 C  L: }
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, d" Q" u/ o4 Q: k) ~$ [    Call PrintCookiesInfo(divSet(4))
( `+ l. @& w* Y1 y4 P    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" T- y% h) i9 L9 M
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
* Z- Y4 {6 r# q6 ~1 d, k7 m9 z1 A    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 4 V0 O) P3 E$ U7 R9 X. V
    Call PrintDatabaseInfo(divSet(8))
( U9 E2 Q; o4 |    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
9 X5 Y5 U+ |, Z9 [' n1 ?    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . l' }1 R( R& a7 @+ C3 z
    Response.Write "&lt;/Table&gt;" , {8 K4 q. k2 H
   End If : X8 _2 l" r" d5 {- i( h6 a
End Sub </P><>'Destructor
! }0 H- _6 w$ R. ~: N: D3 {Private Sub Class_Terminate()
" ^6 B9 \8 e) {0 ^) ~   Set dbg_Data = Nothing * N. \3 ^) \5 A) I% J& A4 t
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>7 W1 l6 V! v, I8 Z+ C1 E
CLASS debuggingConsole   _. y/ @, C8 ?: v  l! ~  w, n+ c
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 2 ~+ Y( S) ]* Y6 E
&amp;n! T* H1 t$ r4 u) W  t. {7 M
bsp; ( f4 |4 A1 v& Q' v7 u
Property Get Enabled===[bool] Gets the "enabled" value
+ e6 l1 a' V# ^) w. |$ b3 a) |  : P$ ^" [/ F2 m3 j$ T# e7 {: Z: H% j7 i
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 ' B* J* |' C$ p
  
7 ?% |9 _5 P6 S% _/ oProperty Get Show===[string] Gets the debugging panel. ( F- ?, [4 U1 I6 ]  ^' n
  
# {, ?7 a; t6 `! z+ FProperty 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' e3 I. r' L& a# h1 h) @Public Methods </P><>public sub===Print (label, output)
3 j' X- }+ M+ P   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ; v# {! o: m  W( G0 y! m7 w1 B
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () : C' h3 |* [7 d1 e9 _3 }
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 9 |- w3 J8 I3 j4 U7 ^: A
Methods Detail   ~, e1 L; X% Z3 t
  2 K  A: G& N2 z; R9 H: W
public sub===Print (label, output)
8 f9 q9 x% A  N4 }( c8 S; vParameters:  
; {% Y$ O0 u6 `9 E( U* B/ o   - label [string]: Description of the variable 7 ~7 l4 y9 G' Y: s  R& e
   - output [variable]: The variable itself ' _' s1 q  i+ b1 R/ a
  
0 v) T: [  R9 W' npublic sub===GrabDatabaseInfo (byval oSQLDB)
6 \- Q2 [) D8 I6 J4 K) t& R, `Parameters:  
, E- V2 F% U  `# a* s3 i, S  a" j   - 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-10 09:03 , Processed in 1.333564 second(s), 56 queries .

回顶部