QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>1 I) m) h( V2 g* U! f
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! $ Y5 L/ [' \; Q
使用方法很简单:
; d; c4 i+ j+ }7 p3 vtest.asp </P>( C/ n, Z3 A; d) c  ]2 Q/ S7 v1 X
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
! x5 K. J2 c1 Z8 H+ W&lt;%
' p" U' U7 ?0 D) O4 _$ E+ Ooutput="XXXX" " b9 c5 a( u3 m6 _1 C+ d0 P
Set debugstr = New debuggingConsole / c5 o1 Q5 X% U  a7 [# w
debugstr.Enabled = true
  Y: j& M  [8 X8 T; w2 Y   debugstr.Print "参数output的值", output , i! _2 J) `) \7 V% p) d
   '……
0 ?3 _2 i. M: r/ B   debugstr.draw
0 g1 D. h* G1 O: _. ~  e) @Set debugstr = Nothing
" X& W: j$ s8 S: a. d$ v%&gt; </P>4 H2 E+ a2 _! c: I; x
<>=================================================== </P>
5 u( W( x5 u4 h* f<>debuggingConsole.asp </P>
* p" L+ I: Q; X% s% l& {9 Q" F# X8 R<>&lt;%
4 ^9 f% a( [% ?) gClass debuggingConsole </P>- p3 H- C4 G; [" D1 b
<>   private dbg_Enabled
2 m  Y" R* N, [/ B- N. g' v* o   private dbg_Show 2 A0 N8 y! Z9 \/ h
   private dbg_RequestTime
' C0 ]3 \7 n' s- D( h   private dbg_FinishTime 9 l* W( J' W) U, t1 Q  m% _( S
   private dbg_Data
- w7 T, g; O) c) l( d   private dbg_DB_Data 6 M9 a# @' U2 q0 G, {, K
   private dbg_AllVars
8 V! Q6 K( w) x" A' U4 x   private dbg_Show_default 2 Z' v6 }! _9 o+ e1 u/ b- D
   private DivSets(2) 9 y. ~& }! Q" L1 U) y- u
   / h; n( w. j4 U6 Y
'Construktor =&gt; set the default values
$ ]2 m! f, A1 {2 F$ B- gPrivate Sub Class_Initialize()
8 z- C) ^" Q( w/ D" k0 d, q   dbg_RequestTime = Now()
2 ^/ X( p4 J, {) k   dbg_AllVars = false 1 i1 \9 l3 E" t9 c- ^
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
6 l+ F( Z8 z1 M( E/ I5 |: {8 h) r<>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>' F; Q1 u% b8 A5 F, V7 g# ^
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
# \% P* n; r6 `, X7 z8 g+ s/ o&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>$ d. X- _. V8 i, Z. I3 j7 L* m
<>   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>: e, |! Y. o  M9 d+ G0 b9 e, p
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 6 W+ t" z2 A# U1 @2 [% Y3 O) A" \
End Sub </P># Z- g) G; E$ \  G8 F2 n5 @. c
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false . N! L, U, P  E% K0 j  v
   dbg_Enabled = bNewValue
! B  x, R3 |1 E, KEnd Property </P>
7 a  a  s2 p$ i, d/ T, `, n' K<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
& D. k" a- f1 o$ v" U& V- E( L& t   Enabled = dbg_Enabled
( H2 M. Q/ r' a& }1 cEnd Property </P>
. T9 t4 a4 v) {2 q, N* o<>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 2 T7 h; w4 s! ^. G* X: e
   dbg_Show = bNewValue " m8 e0 \4 z4 [2 E
End Property </P>
  h, w7 J; @6 ~% ~$ [5 Q3 D0 q* @<>ublic Property Get Show ''[string] Gets the debugging panel. $ Q; P0 J9 g( h  z
   Show = dbg_Show
, {1 I" j$ U2 ~; y6 u/ tEnd Property </P>
- }" _6 J$ Y0 q) D# ?8 Y6 X<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
4 V* n1 X+ N+ m$ B6 a   dbg_AllVars = bNewValue / |, ^. I9 d, N' H
End Property </P>4 i* H5 w( N% u  i
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( \9 w5 F, Q5 p" S- i$ a
   AllVars = dbg_AllVars
" {- P) ^4 p# m/ uEnd Property </P>
7 s" i+ b, ?4 A: f: M<>'***********************************************************
% [4 t, u1 S9 |$ t. [''@SDESCRIPTION: Adds a variable to the debug-informations.
& p& c) E0 _5 t+ V''@PARAM:  - label [string]: Description of the variable , W/ ^" u' K* Q+ j
''@PARAM:  - output [variable]: The variable itself
5 x% P  R8 R/ u- ?. j$ u'***********************************************************
1 N  M: t* z' ^* q1 ?0 B" Y7 ^$ ^Public Sub Print(label, output)
& j4 v, v4 u  f4 e$ T   If dbg_Enabled Then " Z$ ]% W1 K* s4 w! A
     if err.number &gt; 0 then
  P$ R: B% K4 T: C5 B: k       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 2 C) O: |6 |; w
       err.Clear
  o- V4 E1 S3 Q     else
3 p: X, x% G9 B6 s% H$ i8 W       uniqueID = ValidLabel(label)
- s) q# W! M8 \" x       response.write uniqueID ! C  n3 M* }. j$ [
       call dbg_Data.Add(uniqueID, output) - m. q2 J. }+ L5 o4 G/ O
     end if 2 h3 `3 [" g. ~* R( O% ^
   End If ' g* O, |! K- t' U7 C
End Sub 0 }  [! y! Z6 x. x! k
  1 f! |0 W  f9 o# z
'***********************************************************
( C2 m* C% j7 A2 {'* ValidLabel 5 G1 z. o# i$ _' x/ Z
'***********************************************************
2 w( S  O* C3 m: K! TPrivate Function ValidLabel(byval label)
2 \) T% A4 g- c: \0 M   dim i, lbl   Q+ K* X% E' |) z" J3 S
   i = 0
; k: U- q, j$ M. a  Y7 y- a   lbl = label
/ m7 Y& Y6 L  L1 F; v( x, X+ _   do
# i# }+ [+ D6 E2 `9 ]* d( \   if not dbg_Data.Exists(lbl) then exit do ( f4 V, A# w% ?
   i = i + 1
+ _4 Q, V4 L- n6 Y   lbl = label &amp; "(" &amp; i &amp; ")"
- e  v: q: O. t* g- h9 T* f   loop until i = i
/ _3 f# |  d, h  / W. u0 A2 u- f' `+ a/ W
   ValidLabel = lbl / o$ b; X4 Z. L# g8 i( a4 c. \
End Function   ^) T3 r' `+ Q; Q9 a4 A7 u! `
  1 Y2 |$ [9 u) M, N- d7 d
'*********************************************************** % ^8 p& Q8 B! q
'* PrintCookiesInfo 4 g0 P2 {! V/ i; u* t
'*********************************************************** ' f% x9 F! q  H; q. y  r
Private Sub PrintCookiesInfo(byval DivSetNo) ( _5 Q6 f3 R' w' G9 ?
   dim tbl, cookie, key, tmp
) y# [  e/ q+ k; U1 r   For Each cookie in Request.Cookies 6 x. `% n9 h& m7 K; g
   If Not Request.Cookies(cookie).HasKeys Then
5 V7 k+ g* W/ C. m; e% y0 |     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
6 s: A, h: p* f6 m" E$ t# w4 r   Else
, j+ J) _6 ?* `) I' y7 A( {     For Each key in Request.Cookies(cookie)
* f% r, Q- ]# `  ^6 c     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
" n7 G2 J! W$ P; dCookies(cookie)(key))   6 _; ~1 H9 F9 y3 ]) J
   Next * a* E/ F' ~& p, ?9 H
   End If
' Y: T. T& y  J* ^4 ^+ j7 z   Next </P>
9 e8 j! Z7 V2 \9 `% ^<>   tbl = MakeTable(tbl)
" V7 Y! v; b( ]; N% z6 o+ f+ b   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
; u- M. A5 A/ x. ^+ d% ]8 m9 w   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
" w# S1 j0 n* S- G0 ?   Response.Write replace(tmp,"|", vbcrlf)
7 \0 P! P3 f& C- E0 i' {end sub
) d9 V3 s2 j5 O; e  
. h3 S# e0 c- M9 p6 D9 }4 Y8 l'***********************************************************
+ Q; A# ^1 k, ~1 F! ^; W'* PrintSummaryInfo
. [, {* @4 m/ T! P'*********************************************************** 1 L3 v+ C/ ^9 i7 P+ P8 v& ^" l% ^
Private Sub PrintSummaryInfo(byval DivSetNo)
4 K# E9 W6 Q/ E7 [! l   dim tmp, tbl # ?  C: k1 d+ [& H* r
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
5 L" s& J. W$ B% E+ n   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
% z" B# ~8 Q6 ?+ {1 Q7 U  c0 Z! [- r   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
' L, w% v. a* l' P   tbl = AddRow(tbl, "Status Code",Response.Status)
+ R7 z2 Y- h/ J1 d   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 0 T; d: I6 y. Q' U
   tbl = MakeTable(tbl)
$ q* z; L- ?7 w( t7 `8 h1 A7 s   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
- G# a# q5 i! X9 U+ s+ u3 V: \1 S% Z   Response.Write replace(tmp,"|", vbcrlf)
6 R! x3 D# u8 S2 l1 M" d. j( UEnd Sub </P>
, f; W3 f3 o* a<>'***********************************************************
( G6 D7 z2 d5 n* W''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
/ K% d, P0 c- J9 V1 C. i- Z" U''@PARAM:  - oSQLDB [object]: connection-object ) U1 o1 }# V( `2 [% Q
'***********************************************************
# `, U4 P" D5 u+ ?, E/ `Public Sub GrabDatabaseInfo(byval oSQLDB) . D) y- C* }+ S# p- G- V$ _
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
7 e2 G' u+ c  f   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
6 f7 [8 N( h6 G! ?' L   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"))
% s' b2 u" Q' C   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
' z1 }% J$ y# w6 M! F0 aEnd Sub <>'***********************************************************
. L/ O+ _/ U- u! u/ u. {, @. U+ w7 J0 y+ N'* PrintDatabaseInfo ( m  @$ V5 M/ m/ |2 ~
'***********************************************************
' G8 ]7 \2 O0 ^! `& ~Private Sub PrintDatabaseInfo(byval DivSetNo)
( u7 u, d5 o  h* [: F8 f! {' g; F   dim tbl
" _7 ]2 S( h0 v8 M. Y   tbl = MakeTable(dbg_DB_Data)
4 h  T( z- P5 N1 w* [' U9 p( t   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 K& v( N' S4 f! u# C
   Response.Write replace(tbl,"|", vbcrlf)
+ {, q7 I4 V( S  zEnd Sub </P><>'***********************************************************   Z) U+ i. L% ?# n
'* PrintCollection $ _( l( |- v, q- T( k
'***********************************************************
* L  R3 E; b& T& QPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 ?) |0 {+ g8 q/ C   Dim vItem, tbl, Temp " {0 s- Z3 q; K
   For Each vItem In Collection
1 W6 `7 u4 X5 g# N) n     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
  H% S, x, M3 c  y$ U7 u+ K       tbl = AddRow(tbl, vItem, "{object}")
2 i2 U, _  n( ?) }  T/ R     elseif isnull(Collection(vItem)) then
3 T6 a# b7 {, T, P( B       tbl = AddRow(tbl, vItem, "{null}") 0 W& L1 _$ e3 w) H0 q
     elseif isarray(Collection(vItem)) then & J. H+ i8 k: R$ r2 h! r/ j
       tbl = AddRow(tbl, vItem, "{array}")
3 j: Z  c5 Y5 \( @* o! r     else
6 T+ ^! k3 M) N9 ?9 T       if dbg_AllVars then
8 c% v( d$ W5 A* x       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
/ M- h! [5 _! _* Q5 J) L     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 3 m0 b& b6 x) D
       if Collection(vItem) &lt;&gt; "" then 5 L+ P6 V4 ?3 }7 {2 l0 V
       tbl = AddRow(tbl, vItem, server.HTML
+ N, V! `8 I; z  U% |& cEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
( ?! Y1 n  c0 n  a       else 4 @9 O/ p: v7 O% S! ?: V
       tbl = AddRow(tbl, vItem, "...")
4 N, {4 t7 d- X; e4 U* D       end if 2 T- \! H, g5 ~' W
     end if
  g5 F! p  A0 o- l   end if & F" i8 [9 A' ?; l/ N( c
   Next 2 y( w( G1 d/ U: g  L3 Q! m6 x
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
4 u6 }7 F% j3 U$ `4 K+ q5 i   tbl = MakeTable(tbl) . u, _6 W9 J$ A( D% A6 `
   if Collection.count &lt;= 0 then DivSetNo =2
! Q2 I+ _/ \% b% @6 s1 T     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 f- W% U2 E! |6 v7 _+ d     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
9 F( X/ R  g+ w# O/ C4 L  W     Response.Write replace(tbl,"|", vbcrlf) 3 Q4 W' T! F5 {" s
End Sub
, D; Z% Q2 z. {9 {0 x9 c  
9 K/ n% C  C* V$ c! |'*********************************************************** $ t5 n! K5 }) W4 j- G0 \
'* AddRow ) f3 n3 d6 H7 S4 q  R7 b
'***********************************************************
& `+ S  D9 n* kPrivate Function AddRow(byval t, byval var, byval val)
0 y& c4 _, y) V, S4 V9 m6 ]   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
0 N+ T. U) p6 O8 D$ k( F   AddRow = t $ Z  ]; `  e* _. {
End Function </P><>'***********************************************************
2 B; q+ G. O+ v2 k9 S6 \2 h'* MakeTable , A' a+ r6 X- e' n' u
'***********************************************************
- U: |4 N& D- R7 JPrivate Function MakeTable(byval tdata) ! w6 U2 q3 h( {# i& [0 H
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ) o6 n* S7 {8 _2 R
   MakeTable = tdata   t' r6 I7 F; U( L! v
End Function </P><>'*********************************************************** ; c9 z, H! E  M2 i+ V
''@SDESCRIPTION: Draws the Debug-panel
* \" |+ |# G  m1 A: N1 v'***********************************************************
9 r1 o; j* y9 a" h: C, X  EPublic Sub draw()
: _$ G2 j& E  Y, O   If dbg_Enabled Then / c7 q( `; m# j% J- _- V
     dbg_FinishTime = Now()
4 o- R, R! T' d( f1 K/ m1 y# C) Z  8 v4 E1 v) H+ z
   Dim DivSet, x
. E+ d; ^2 `) e" y4 S   DivSet = split(dbg_Show_default,",") 2 F) l- G( O" f/ E4 s: e
     dbg_Show = split(dbg_Show,",")
4 \1 E1 ?7 ]4 V# ^& w8 ^( F0 e  
7 s' w% I/ R7 o5 ~   For x = 0 to ubound(dbg_Show)
7 C) y. p- U' [+ J, I6 R+ N     divSet(x) = dbg_Show(x)
. i9 b. G9 `/ h! Z6 k3 \8 V3 A   Next , V/ x$ H' c( F9 G8 m" d
  
( _/ C4 |. H3 {   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;"
4 p8 i) n3 M( `2 {, f   Call PrintSummaryInfo(divSet(0)) # M, k: ?3 Y' ?  m
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
" J7 l; {7 ~4 I! t    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
" F  ]+ ^7 I* e    Call PrintCollection("FORM", Request.Form(),divSet(3),"") , m3 A, N/ M; V9 z1 y
    Call PrintCookiesInfo(divSet(4))
5 L2 P+ T) H2 i3 j  g    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))
" F; F* o7 }0 h, A    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
# A! |# t6 g! i* ~; o: A    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
1 u% G# M. I; F0 g' F6 N    Call PrintDatabaseInfo(divSet(8))
' X2 {% i) @' c. o# K    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") . o) p, D- |# u4 O. V
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 8 c2 B; G5 b" t3 U" o' i
    Response.Write "&lt;/Table&gt;"
# R: u2 J3 W  k' x( `! O1 F   End If   X& k3 [! v8 v4 K! F
End Sub </P><>'Destructor - K9 P9 p$ Q; N; k; j- C2 I2 B2 b
Private Sub Class_Terminate()
/ t# s: d& m1 ]* d   Set dbg_Data = Nothing
( x% W/ Y. T* C/ t. WEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><># W$ g# `0 g! d5 q& c3 A& g
CLASS debuggingConsole
6 A% {7 x. @4 {( l4 NVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " i4 P+ O/ N) i: d/ t& t
&amp;n
" K! x6 o( c" ~4 _  ]bsp; 0 Y* w) z' L" B( ^; K8 F, v
Property Get Enabled===[bool] Gets the "enabled" value
$ r. Q$ {1 r0 Q* \: R, P  
; c6 P# Y  H7 Q0 ]; WProperty 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
, O9 B8 P# ~3 u, c% {% W+ d( S  
5 D, r  b* s0 a' W; R7 R* tProperty Get Show===[string] Gets the debugging panel. . i2 X, S9 t! h) P! ^2 D  E) r4 W( {
  0 f. F" U6 }- q1 _; K- l" u
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><>-------------------------------------------------------------------------------- ' B8 a; D5 A1 q1 R+ N' y* r
Public Methods </P><>public sub===Print (label, output) : d* M/ B( e9 f  K
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) ! ?5 p! h7 m  P8 U3 |5 D9 h
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 3 p% [/ [6 f0 q7 [
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
( O( m/ ^7 \* T  |$ @Methods Detail
! P" w5 i7 h9 y- n( ~# Z  ' ^+ p6 r6 z& M% B* Q0 l; Z$ |
public sub===Print (label, output) 1 m  j9 M% x. Q+ O* h1 w/ P
Parameters:  + A, o- Q+ J& A
   - label [string]: Description of the variable
' M# V0 N5 s$ E% Y3 r9 e: S4 X  n   - output [variable]: The variable itself
1 a) R- W+ K+ g/ s) J, B% ]6 K  6 v  z% M$ {8 f
public sub===GrabDatabaseInfo (byval oSQLDB)
- J. _$ o( J: V2 F8 i$ D0 DParameters:  
6 L5 g0 _+ i% Y$ b  z" F   - 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-4-15 07:41 , Processed in 2.680627 second(s), 57 queries .

回顶部