QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>; S3 R" i$ u( b- `2 j6 d0 X' x$ m
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! . h6 H+ c  R  d
使用方法很简单:   Z9 U# B8 ~& y! w9 g2 M( ^3 q
test.asp </P>6 j/ e6 G! d6 B
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 9 Z5 k  i# ]" F1 A1 A
&lt;%
% h! C3 F2 C% T5 ~) _8 w) V$ x+ H, ]1 X/ `output="XXXX"
" z3 X* ^- {" w3 U# `9 XSet debugstr = New debuggingConsole
9 A; `# {' ?2 [$ H8 {debugstr.Enabled = true 0 D. [8 I8 F+ I! q2 |
   debugstr.Print "参数output的值", output
8 V- c2 T# X7 s& \5 ~9 P% e/ L   '……
6 b/ h# ^7 \/ t7 H3 H   debugstr.draw
- P. A/ A0 J( v) w! ~Set debugstr = Nothing
/ O* v- \1 g/ C3 L%&gt; </P>
, D) d6 n! L6 a& f. Q! \! A) [% s<>=================================================== </P>! t0 L1 \/ `& h# {6 j( `4 L. u
<>debuggingConsole.asp </P>. Y; O5 k  X* z9 w) {
<>&lt;%
6 z* R  b8 \+ P3 Z3 iClass debuggingConsole </P>
4 g' e! l; M5 V1 P<>   private dbg_Enabled 1 K  I  O, C( |( J# T: ?+ F4 s
   private dbg_Show 8 m* B& p" V3 a7 ^; Z) m
   private dbg_RequestTime & \! y5 G/ K  e; E
   private dbg_FinishTime
9 l& D8 C+ m# A: s   private dbg_Data : d, B8 j+ C+ t
   private dbg_DB_Data / L! ^. R% L2 c/ C
   private dbg_AllVars
% Q  F4 \( h% {4 t/ \8 L' F   private dbg_Show_default
7 p, Z8 s2 V$ m   private DivSets(2)
1 f7 t+ |, H: ^  h! I   9 [2 s( v  i4 j# }- p! k
'Construktor =&gt; set the default values   V" ?- I. Z( T( d, P8 j6 ?
Private Sub Class_Initialize() 3 }' m; e+ V; l# _! o
   dbg_RequestTime = Now() 0 G4 I2 g& W, T* x4 q- n  y
   dbg_AllVars = false
/ a; o1 K2 ^9 F" Z' O% R- D   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>" B/ v* O4 v9 Z4 Y; C
<>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>
9 w; d! r2 L* R0 ^  Q<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
+ z* O( H3 S- s' X4 a* c&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>
# B+ L0 c7 ]+ t$ n9 q; O2 u1 B<>   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>7 k/ F- i4 P1 F& C" w
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
# L; E% r, ~" }0 YEnd Sub </P>/ e. k: B& M; G; h! n
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false : t8 \8 E5 U: Y1 K
   dbg_Enabled = bNewValue
5 A; H" N) A& X2 K/ Z' ^/ K& aEnd Property </P>
5 W. e, a% w  u1 r! h. k0 q<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
" e: C# {8 S' J: ?) C3 o: |( }5 F4 n   Enabled = dbg_Enabled
2 L& r& u; Q3 a4 }End Property </P>& C/ h) Q; R# r2 w- `; j% 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
* y( M/ u* j6 V: U5 D   dbg_Show = bNewValue
/ z" e' ^( ]% o% z1 m" |End Property </P>$ G1 U, u; D/ A0 j9 i
<>ublic Property Get Show ''[string] Gets the debugging panel. * ?2 f1 ~# {" E+ @/ F
   Show = dbg_Show
5 s5 H1 O4 Z9 L; l9 jEnd Property </P>. ?+ g1 `( P' ?7 x) L! p
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
8 @. m) w5 o7 [) \% L0 {   dbg_AllVars = bNewValue & m) v9 u# l" N
End Property </P>' K8 P. ^5 B% H3 h9 Y& M
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. * y6 C: `+ A/ k; g$ m9 L6 H: W# C
   AllVars = dbg_AllVars
$ b, l5 g6 @5 u9 p* ?  n$ eEnd Property </P>5 Y" Y! z2 Q( I0 e) O( {
<>'***********************************************************
& A- n2 u: o1 b2 ]# }''@SDESCRIPTION: Adds a variable to the debug-informations.
6 N4 F" m3 Y) Y( _6 }6 r''@PARAM:  - label [string]: Description of the variable ; w4 P) k5 M9 H$ c
''@PARAM:  - output [variable]: The variable itself
9 {0 g( m/ `) C, u  H& l" |( f'*********************************************************** 0 Q0 q$ o% R1 |# V. T
Public Sub Print(label, output)
6 f/ p" B. ^. C0 F( F% M8 v   If dbg_Enabled Then ! G2 F# \3 b$ A+ A/ h9 L8 v
     if err.number &gt; 0 then
2 g9 u6 G6 V" Z, b( Z       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 0 z. ^$ h' _6 w8 t/ ^/ N% t! H
       err.Clear . S$ [+ j/ X* V( l( k+ x0 R
     else ! j* {( M  N: M
       uniqueID = ValidLabel(label) ( q  s% E1 H& m+ c' l/ X) u; B5 G
       response.write uniqueID
0 G- m1 @0 P3 n& k7 o8 I       call dbg_Data.Add(uniqueID, output) # m3 T* e6 G0 V) e
     end if ! J# c3 ]; i/ X# [& o
   End If / C' l% X. }5 L! J$ z
End Sub * W% y. h7 k0 }' |
  0 N& X4 G6 |8 k0 T
'***********************************************************   D% y5 T+ Q0 p' O
'* ValidLabel / d2 g  P- ], `4 ~
'***********************************************************
( z2 h) S/ J& b, N2 O, O# q. y' NPrivate Function ValidLabel(byval label) + R$ x# @6 w- F7 h$ l
   dim i, lbl
/ u, S, l% s8 F+ C   i = 0
; Q" ~! f' \$ S) @( |   lbl = label
9 P. O1 A7 O) ~: K. D# u   do
7 G" b% K7 q9 C% M& w: f0 I2 ?& U   if not dbg_Data.Exists(lbl) then exit do
% |+ m5 n; ^) H4 m) ]   i = i + 1 + ^) H! G# @; V
   lbl = label &amp; "(" &amp; i &amp; ")"
" f( z! S% r! A0 P+ w- c   loop until i = i
. c9 Y: K8 [/ ]7 r3 ~  
! {% o, v1 `$ |7 d" H   ValidLabel = lbl 6 J  p+ u$ k7 f- l1 \3 h  [9 E0 G
End Function % P; D- Z* B' h0 J& I6 U
  
; O! d& l7 W. m+ D6 x'*********************************************************** : l2 F! d; `2 N
'* PrintCookiesInfo
4 o# Y3 W* Z& j! a1 V'***********************************************************
# Q. J9 Y0 \( @0 L. [* H7 MPrivate Sub PrintCookiesInfo(byval DivSetNo)
% P; M- ]1 e- x5 t+ M) W   dim tbl, cookie, key, tmp
4 y% c" V4 L2 {, W% m8 K   For Each cookie in Request.Cookies ) Q0 U9 k' }' f# J
   If Not Request.Cookies(cookie).HasKeys Then % S- G7 b, @, W9 q- J  k
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   . m2 ^5 b7 W! t% L0 g" X/ D
   Else " j9 W7 U4 k" K% q2 ^) o$ ]: s& n
     For Each key in Request.Cookies(cookie)
% ?! @; e* q( T     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 6 V1 Y4 d8 g( v+ x4 y$ |+ X
Cookies(cookie)(key))   
2 }9 B' O% U% D' }1 H   Next
1 I2 Y/ K( x6 }! l. r   End If
; Q8 ~+ S- y: ~# C6 F5 d% `   Next </P>
& O& k$ s: r; y6 V* g1 W, }  l<>   tbl = MakeTable(tbl)
. D9 g2 ~& g6 L% o1 G   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 $ h' z; Z5 a8 Z  l
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) , |8 r- b1 z7 U. W
   Response.Write replace(tmp,"|", vbcrlf)
; i; A" }# k" |. g. _) gend sub ! i5 G7 M8 e6 [$ L: r& g
  1 r/ L( U( _2 ~& v  J
'*********************************************************** ) `# z2 n. d" ?
'* PrintSummaryInfo
. V0 d$ U) P  a; m1 i% {0 P0 E: n'***********************************************************
9 E& r# c- V0 p7 D! TPrivate Sub PrintSummaryInfo(byval DivSetNo)
+ ]5 ^: T6 i% H& Y1 p" F  a! l   dim tmp, tbl 5 T0 b& t1 i; \; W" `8 l9 ?6 I
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) $ E* e0 n$ c& C% Q  b$ v2 w/ i* W  U
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
3 d$ l) i4 z4 v* ~) T! S   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
  g& _" h9 A4 L- y+ J; q6 x   tbl = AddRow(tbl, "Status Code",Response.Status)
4 {9 w! H) H' b   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ) i; Q4 e/ {( L4 o& l  Y
   tbl = MakeTable(tbl) 7 o/ G! q$ T% L% _# ?3 U" ~
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) . b3 q# m9 @) E
   Response.Write replace(tmp,"|", vbcrlf)   g. t8 L% V% ]. s: R3 {
End Sub </P>
( \" Q( p/ N) ?: n" A6 G+ I: h  z<>'*********************************************************** ! A; y! c) Q. `$ x9 m: h
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
8 H$ S* I! J4 n' A6 r. p' `2 m. @''@PARAM:  - oSQLDB [object]: connection-object
$ F0 W4 r8 L: Z7 g, h- N/ l'***********************************************************
) e' U: M3 ?/ t7 nPublic Sub GrabDatabaseInfo(byval oSQLDB)
/ j+ A2 \( E: C8 N! R1 M1 l   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) * s( r" a( r8 j2 k) c
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 8 ?. `: ^! _2 p7 k
   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% F/ `$ U# h) e0 E2 O+ W9 b   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
1 Q9 \$ V( f8 I  |7 v; Q8 T2 t: J0 IEnd Sub <>'*********************************************************** + D: \7 V2 j8 Q5 q
'* PrintDatabaseInfo 8 `* O5 r$ I/ B( N( ~6 d! d4 x5 y
'***********************************************************
7 Y/ h( H" k: S, zPrivate Sub PrintDatabaseInfo(byval DivSetNo) + \- y6 _$ \/ n7 ?- z
   dim tbl ( M, x1 B( S8 m" x% Y4 f
   tbl = MakeTable(dbg_DB_Data)
8 Z, g3 S+ F2 R9 d: a3 |; Y   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
/ S/ M, [) a9 k, C9 ^   Response.Write replace(tbl,"|", vbcrlf)
9 n, w: |9 o# REnd Sub </P><>'*********************************************************** 5 y( E  M' X2 b
'* PrintCollection
0 _) ?9 ^; ]% o- G) H'*********************************************************** ; S3 b5 Z) V8 `
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
- \: q  g$ l" x$ B   Dim vItem, tbl, Temp + b. w$ V2 p" E9 q  M* v8 M$ Y
   For Each vItem In Collection 3 h# D! n# ~* g, B
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 6 h9 |, @+ [, ^( k4 m/ C, |  Y) i
       tbl = AddRow(tbl, vItem, "{object}")
* U5 d8 C5 r) C  ~; D     elseif isnull(Collection(vItem)) then 2 q: ?' y: L7 P8 x
       tbl = AddRow(tbl, vItem, "{null}")
6 V' K6 T4 P: O# \! c% T7 u     elseif isarray(Collection(vItem)) then ' m5 X# k& p- _- r+ E
       tbl = AddRow(tbl, vItem, "{array}")
5 i- J( A/ f, w8 [( y  y     else
/ n; _, E  ?) h. ?) }* n: y' H       if dbg_AllVars then
2 v+ A; I$ R6 a* B7 p1 G* m. W$ j9 \       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
0 o  I) h; u' Y. H: @     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
; I. _  P: ?: \2 y" n3 ~4 H       if Collection(vItem) &lt;&gt; "" then
' ]5 M$ [2 h4 O+ m, W       tbl = AddRow(tbl, vItem, server.HTML% a( V& k9 h5 j
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
$ ]* o8 T$ c! _& S3 v9 u       else & I' ?7 B: d, d; y
       tbl = AddRow(tbl, vItem, "...") % n) F) Y4 R. Z* [8 |; [
       end if
# P/ q, s: Z* l9 a  G1 |2 q/ d     end if % I5 \7 L* y6 p3 B; x% X
   end if " Q, Y) h# a, I
   Next
6 N/ _/ Y9 c# Y   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
3 x1 w$ h" w8 ?5 N. x! p   tbl = MakeTable(tbl) " e" |; l2 G( G+ P5 G( m3 u
   if Collection.count &lt;= 0 then DivSetNo =2
5 U" E; `$ B* Y: B5 n     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) y& B# m, e) ?) y" X     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ Z! X' }2 a0 r/ N) j6 E. @0 H: }     Response.Write replace(tbl,"|", vbcrlf)
" F# M7 b  s3 a6 qEnd Sub
  m% e: U3 y$ z7 L  
# M: M' ~4 ~+ q( ?4 h'*********************************************************** 9 L9 k& o- X5 S
'* AddRow
( H; E6 J' g1 w2 W'*********************************************************** 6 K" D* t4 d9 U4 N
Private Function AddRow(byval t, byval var, byval val)
$ N! `6 x( x9 x. W, U   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
0 F* I$ i+ i; W' N+ S4 H   AddRow = t
' o1 b7 C/ ^6 NEnd Function </P><>'*********************************************************** " q2 ], T9 m# W
'* MakeTable 1 x' {  m# w- d9 ]" P8 Y
'*********************************************************** 9 b5 z& m6 e! T) [; ~2 h; o. C
Private Function MakeTable(byval tdata)
- O" l5 }' J2 V+ D8 ?   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
. \. Z0 K$ l4 x- M   MakeTable = tdata
. P; a0 ?6 g& f$ d- E: eEnd Function </P><>'***********************************************************
0 e$ n) e$ \0 d3 o5 Y  p# t+ X''@SDESCRIPTION: Draws the Debug-panel
7 R. l! p; E# j, D8 ?, f'*********************************************************** & c) m6 y  \. M* t- z
Public Sub draw()
& z% |4 B9 K! i$ i# S& ~   If dbg_Enabled Then 0 p5 S' I4 {# A. j$ g+ e
     dbg_FinishTime = Now()
  M" B& D/ \1 f# q2 a  , H8 Q* K) k0 C5 s" i. S/ ?) _4 N
   Dim DivSet, x
, b5 |% q( T2 a! E& u1 x* @! {9 P   DivSet = split(dbg_Show_default,",") * g- R5 I+ T) |5 c
     dbg_Show = split(dbg_Show,",")
! y! n9 V/ _% s: S* R2 H  
: c- A0 V- ?  ?/ M$ V" F  l   For x = 0 to ubound(dbg_Show)   [) O0 c: G! _! P
     divSet(x) = dbg_Show(x)
- p9 @2 {& A2 U/ z( x   Next 1 K6 n: n! s& u
  , \0 F9 D3 }% K/ H" N8 C4 M
   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;" 7 A: F7 \/ |+ {; I  ?
   Call PrintSummaryInfo(divSet(0)) / k; _% @% D& S
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
+ D$ X9 U* z( p; i    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") & ?2 p8 R$ b& H1 C" x! i
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") # }$ j$ c# p7 n2 ], }  B
    Call PrintCookiesInfo(divSet(4))
, E4 e; r8 A+ ?8 r    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))
) X3 V& k5 l% U    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
' v0 i4 j& w  k2 `    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 4 B; S& x% Y, D5 o# n& j5 B1 q' T
    Call PrintDatabaseInfo(divSet(8))
6 P& e# f# L. q, k: u7 c    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- w1 i4 l8 g5 v3 h4 |0 ^    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . H. _) q# F* D9 w/ t
    Response.Write "&lt;/Table&gt;"
, C# ~" }6 P$ e0 T5 |   End If
+ o0 W! ^! O' u9 e2 J( V" l7 p) D% y0 s' HEnd Sub </P><>'Destructor 2 x8 [  l3 [: G4 B+ A1 R  T9 n
Private Sub Class_Terminate()
. Q( P8 B6 i, X4 G" y* {   Set dbg_Data = Nothing + x- X9 t% d5 O* x
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>- f% N- c+ N6 U
CLASS debuggingConsole
% f' i( h4 B8 ?/ d- j& @: K4 QVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 x( ]1 g$ |# _& m6 K5 @9 {6 }
&amp;n
/ o7 B5 X7 I0 o7 J# Ebsp;
# ^4 ]4 T3 v4 s" RProperty Get Enabled===[bool] Gets the "enabled" value
& g8 y9 ]" ]/ v+ }  
+ x, E6 _( }" `7 N2 Q  I) 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 * W: Q, k: j% z) J5 l
  
4 F$ K$ i0 W  [2 l9 O, S! _Property Get Show===[string] Gets the debugging panel. : h9 d  T" r, Y( k
  
* H3 `" L- I5 q" w$ l" D" V9 [# UProperty 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><>-------------------------------------------------------------------------------- / P3 \% j6 ?. X; L* T- \
Public Methods </P><>public sub===Print (label, output)
0 V6 j. P6 T4 P   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
, x# E$ J2 G0 k1 g6 J. b" i4 ?  z   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ! v: e2 [+ G* h& a4 n
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------   Y; F+ D( l! L( d
Methods Detail
$ H% M2 `( `0 }; _  % @9 C% r% X. A; o: A$ F+ Y, i
public sub===Print (label, output)
) a# n* b& [1 j; B" A% ^9 RParameters:  9 m, c! t5 r5 N' Y( Y/ K4 X" ^
   - label [string]: Description of the variable
+ x1 u0 G8 @. J, W& Z7 _* e2 E   - output [variable]: The variable itself
* J' i$ Q' ~( F" a: `8 \0 G' t9 t  
0 x0 y5 N: U, C1 |" Npublic sub===GrabDatabaseInfo (byval oSQLDB) ' Y# g# q; w+ Z. D* i3 O+ w$ t1 M
Parameters:  + Y) w1 M0 \1 n6 {% {# `% i
   - 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-9 23:58 , Processed in 1.588756 second(s), 57 queries .

回顶部