QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |正序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>: g7 x/ F2 V, L
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 4 W) B" a  j5 f) u2 {
使用方法很简单:
, J, u/ H7 a9 rtest.asp </P>4 s5 b$ Q( z) w# Y, n2 q
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
) J6 O1 G. k$ {0 T3 k$ Z&lt;%
2 S. F4 ?9 [: l# }, l5 [& C5 [output="XXXX" 8 o  [6 T& J) d3 i3 l; p
Set debugstr = New debuggingConsole
" C, K8 X. w2 `- I) Odebugstr.Enabled = true
4 B0 `# k8 s/ o7 W# |% M# D4 G   debugstr.Print "参数output的值", output
% z# W# {# C8 j  L5 }: o   '……
8 I9 ~. J: U' c( |7 e   debugstr.draw 7 Y) N4 n* }% C9 K& G/ u  M& U
Set debugstr = Nothing
9 s/ k- z  d8 K' H# N- ?1 l% G%&gt; </P>+ h. T2 i3 p# W3 K
<>=================================================== </P>
9 x4 n% @/ {9 ?, O: ?<>debuggingConsole.asp </P>9 f' H2 }/ y& Y; {( P2 S  j
<>&lt;% 4 Z0 P' R8 v3 {/ u
Class debuggingConsole </P>
, m( J% P/ V# T, q, m<>   private dbg_Enabled 4 Z. _% f# @% A- @* `
   private dbg_Show 1 B( v  y3 k4 L9 l; Y: A5 V. S
   private dbg_RequestTime
  h. K8 x0 j! h* Y/ {   private dbg_FinishTime ! C& r; D8 U  r# y
   private dbg_Data 7 [  m0 |, s5 M4 h9 e9 U
   private dbg_DB_Data 9 T: _% v) Z: p% G: |) V4 `
   private dbg_AllVars , `: F! F* K/ h6 P' r
   private dbg_Show_default $ k1 s; ?4 P; S. u& \% [! \9 A6 t
   private DivSets(2)
7 f3 [. P" l) ]   + c' }0 E6 W) v) U. o! e1 y
'Construktor =&gt; set the default values 4 c- c% ~" T& {3 x
Private Sub Class_Initialize() 8 Z- P5 L+ e# N8 W
   dbg_RequestTime = Now()
5 _7 O. u8 ]( F/ ~   dbg_AllVars = false
+ I& {7 z- l( i: d3 z# [9 v8 T   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>. L* f: M- a8 p9 `/ 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>
' |; N  \  B, ^! P8 p5 D<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;8 M. C# t- B0 ^2 [* y
&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>
2 K* y' v4 i  q+ _( D# D<>   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>
% Y  Z. |9 B; n; U7 E" T<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
# w! r$ V! q) X( G3 w, K, KEnd Sub </P>
% _; K% r8 L' d4 k2 J<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 6 Z* Q4 C, U) g6 d
   dbg_Enabled = bNewValue
( }9 S6 c$ w4 SEnd Property </P>4 X9 h+ `, c+ X
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ) _% E$ G) m) `
   Enabled = dbg_Enabled
' C/ ?/ C/ i! z2 P8 ^End Property </P>1 B9 y0 h; m' O1 r. Z$ W' d
<>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 ( ?; k2 D1 }' ~1 L0 J. ^
   dbg_Show = bNewValue 9 G+ I4 T0 Y( a: V: q/ x
End Property </P>
* N" D. _& J/ C2 L<>ublic Property Get Show ''[string] Gets the debugging panel.
, j  w% H% g- {9 K+ a# Z2 J! o6 T   Show = dbg_Show
6 j; ~9 O1 ?: U$ B5 F' m7 AEnd Property </P>
+ K: U* W7 u, O: d) l( v" x( _<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
! W0 h  T2 R/ o5 _- t& \   dbg_AllVars = bNewValue $ ^6 j6 h, e$ t' F
End Property </P>
% y8 x/ _. A  l' m: r/ d, K0 R<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
8 l1 X$ @' Y' c* E- j# c; g   AllVars = dbg_AllVars 9 o; a8 g8 U$ h
End Property </P>
" N- p6 p/ E# H' o! J+ r+ h: o<>'*********************************************************** & v6 h) b1 K* b: ]4 F  ^$ F
''@SDESCRIPTION: Adds a variable to the debug-informations. 7 S& x: Z% L7 Z2 p. N
''@PARAM:  - label [string]: Description of the variable - Q  _  ?2 Q% x
''@PARAM:  - output [variable]: The variable itself 4 [4 V7 a( w4 d! F) I2 T! _
'*********************************************************** % q% X; z/ f! \
Public Sub Print(label, output) & w4 V0 V: ]8 ~% g  |3 n
   If dbg_Enabled Then " `% P7 Q6 }( E/ A+ r2 r
     if err.number &gt; 0 then
! G* m& M* Y3 e* i6 V4 X2 f) a       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ! @& X& G/ w/ k2 c
       err.Clear
* ~4 s; w; M* g+ j     else
/ C9 u9 n: F# j0 j3 |4 B       uniqueID = ValidLabel(label) 2 p6 k; x0 ?+ t$ Z: b6 k4 e4 |
       response.write uniqueID
% g( w" k7 z4 Y! ~' \       call dbg_Data.Add(uniqueID, output) ) [/ \5 C2 k: ?1 k* y, X  q4 \
     end if
8 B3 }4 X6 e/ X, h' Z: b% `2 A3 h   End If . [# L8 r# Q) A
End Sub
4 d; ?# O" Y( Q- }1 B  0 x8 ?% b3 h, X6 b! q: z
'*********************************************************** 8 j/ I: g( x! y5 p: N
'* ValidLabel - q6 m+ w! W' T/ U. h
'***********************************************************
! s3 Y! ~; Y9 i4 O6 bPrivate Function ValidLabel(byval label) & O5 p1 {) ?7 a: p+ t
   dim i, lbl 5 i4 k  p" [0 B3 z, r0 q& d
   i = 0 & C' {9 A0 ~- h$ M1 E3 y9 @
   lbl = label + y/ W3 |0 j% y6 L0 Q
   do ; C/ D# F3 o% ?! S1 i
   if not dbg_Data.Exists(lbl) then exit do 2 q- U6 N& i# l* P" T8 N
   i = i + 1
. Y* U- ?: j. R3 q3 c) t5 H   lbl = label &amp; "(" &amp; i &amp; ")" ( a+ T# x0 _7 A. D
   loop until i = i # s% ~# d4 I5 X: G$ C8 E
  0 j$ W% v4 Z  j$ h& V! m
   ValidLabel = lbl
& h1 a, s+ ~  e+ @5 W( I+ D' N0 pEnd Function
1 Z# j. R: p& y2 E5 e9 v  + j9 f- Y' |% Y, y
'*********************************************************** " ^9 |7 }% ~5 y" R, y' C. [
'* PrintCookiesInfo
  K. ]* [, t0 i8 Y1 h8 F- T'***********************************************************
: d3 [4 `+ m2 P; c( tPrivate Sub PrintCookiesInfo(byval DivSetNo) $ r; I+ F' L$ _2 z. T( R- _
   dim tbl, cookie, key, tmp
6 G& j" g1 O; c3 h   For Each cookie in Request.Cookies # }& ]5 b0 e3 Q! E
   If Not Request.Cookies(cookie).HasKeys Then # Y, M* J$ [  E, x' s
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ T- h, @( C8 M2 L. ]% y2 v4 o   Else 1 n# L( w+ r# K% R
     For Each key in Request.Cookies(cookie) " U2 \' F! l, s+ c7 U
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ; n" I( ?# W& K- {! K
Cookies(cookie)(key))   
( Q6 K- u6 s6 J' Y6 c   Next 3 w5 q/ W2 _' b+ N2 d" B4 E7 p
   End If
8 g2 r, g! ?, X0 M   Next </P>: x. W5 H! n0 s* e1 ^# X- }
<>   tbl = MakeTable(tbl) % L1 e1 [( ]! C$ g; S; M4 |
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
# x2 d" C, z2 D' k: r& H5 k4 \   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ) r8 Y! H, q; z( a3 T
   Response.Write replace(tmp,"|", vbcrlf)
9 y: @" _* M! Zend sub
; l: N( q+ b# E  6 o# Q, |3 a, r, H% v$ u, q8 X4 \
'*********************************************************** 4 U# V# J, r. G" |  F  t
'* PrintSummaryInfo
2 |, _7 Z- I* N9 ?'***********************************************************
6 \( t2 q: ~  Y+ s, {. ?Private Sub PrintSummaryInfo(byval DivSetNo) 2 i% J* e) v4 n- u  x: W, g( N) H
   dim tmp, tbl
% ^) R9 Y2 T5 ~   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
) v7 Q# K9 X1 y! x   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ! }( p2 l1 d1 y0 ?( l
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
" Z, P$ s7 q0 z0 I5 m5 A   tbl = AddRow(tbl, "Status Code",Response.Status)
* p% G* r5 \: x  V   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
3 P3 h0 r( c- Z& l3 y; p& U   tbl = MakeTable(tbl) - j. k( a. e+ a" t% `  q
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ( Z4 a; ?+ V- F) {' x
   Response.Write replace(tmp,"|", vbcrlf) 0 f' ~& w4 E4 j' C5 E; Y
End Sub </P>+ d! k* P$ l: {3 K; B
<>'***********************************************************
7 N5 g% c2 f% d3 q0 c" h+ O* ^* N''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
6 R) N4 i' ^4 I''@PARAM:  - oSQLDB [object]: connection-object ! D& h+ _. A. l, w( F! ]
'*********************************************************** + z8 x. c+ ]% Y  n, }& ^
Public Sub GrabDatabaseInfo(byval oSQLDB)
) E  i; o  O: r, s; G! p   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
+ Y! C. D% {; \* J) v- T$ n   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
: {$ P- j2 A0 G" R8 D   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")) : c( B% E0 j& j$ F: z+ o/ c* E- C! K
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
+ a" y1 F7 i$ ~' g2 S# ]1 r: TEnd Sub <>'*********************************************************** : Z7 [3 k& |" j# ^
'* PrintDatabaseInfo
5 `' o; R" B8 T- b  d'***********************************************************
- f' Z9 `$ i! v; uPrivate Sub PrintDatabaseInfo(byval DivSetNo) " e( u1 X5 E1 V
   dim tbl 8 \& o9 a8 J2 {7 U/ y% x: F7 U+ O
   tbl = MakeTable(dbg_DB_Data)
/ k2 |+ L1 r# l0 h, m2 I   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# g' ]! r: R1 a4 e4 X9 g' i   Response.Write replace(tbl,"|", vbcrlf)
# I( R5 H; D8 Y2 t- s- }8 w0 u$ ?End Sub </P><>'*********************************************************** " x2 Z3 A) a8 M
'* PrintCollection 1 X. f4 w: M( q8 i2 p# A0 Y
'***********************************************************
. J8 V) b7 Y+ SPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
  @( g4 w$ N5 y! s   Dim vItem, tbl, Temp 2 V5 D+ @0 Q7 G: W
   For Each vItem In Collection
; x6 g, u* d! e% q8 S2 `     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
' _7 \" o! c8 S' {4 H) T       tbl = AddRow(tbl, vItem, "{object}") 4 E- b' }& W9 V1 e* Y. c/ J
     elseif isnull(Collection(vItem)) then
5 d# Z" w& F; O( l. }0 D' r       tbl = AddRow(tbl, vItem, "{null}")
8 z6 O0 _4 X% A  ^0 [4 r     elseif isarray(Collection(vItem)) then
5 o' O. S8 j0 G. u7 T) U       tbl = AddRow(tbl, vItem, "{array}") * i$ n+ B0 m+ `" W" k& A
     else ' {' U5 [$ T) l4 V/ E
       if dbg_AllVars then
0 }, j' W" [1 l& v       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))   r8 s( @3 B( t
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then . e. y0 S* ~3 m) p6 F
       if Collection(vItem) &lt;&gt; "" then $ @! m6 G$ z0 r, ?1 |; U
       tbl = AddRow(tbl, vItem, server.HTML
; A1 e; g% m1 L2 _6 ^# QEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") - h  K+ l# I5 `5 m4 e  K) B
       else
1 ^& `% X. c: E8 C8 ?; Q- m2 W       tbl = AddRow(tbl, vItem, "...")
  [7 J0 X3 ?& P1 ^$ m& p# C6 K3 r9 i# ^       end if & ]/ t2 [  _3 P2 K( V; [- ^# P  Q
     end if
! T, F# `) X* z! O* w2 _, n( o   end if
9 _# Q9 w' y' {* M" k   Next ( R( Z2 t% S% 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 + w0 b1 h% G* _4 F1 z. D6 ?+ `
   tbl = MakeTable(tbl) 0 O2 @3 Q5 w! ?2 v
   if Collection.count &lt;= 0 then DivSetNo =2
* y" h, g+ _, j/ N& P5 C3 ]* V7 @+ E     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 3 s& q4 U1 {/ W" `+ z
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) & M$ v& N. g8 \
     Response.Write replace(tbl,"|", vbcrlf)
: y. _6 Z/ z/ D. G$ aEnd Sub 1 F" Y' {$ g4 o
  
! ~5 j! J& v8 C! ^  O3 B+ ^: v'***********************************************************
$ b9 A! c+ G, J+ z'* AddRow ! E) o9 k. {! {6 q
'***********************************************************
3 H' v+ o! Z1 `3 G* GPrivate Function AddRow(byval t, byval var, byval val) 9 a5 U  O& }6 N9 K
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 3 J1 d; l0 z; I
   AddRow = t
% M" Y& x7 H+ C& h; ]End Function </P><>'*********************************************************** 3 q; q( t4 w3 R: A/ z! x" d
'* MakeTable 9 J4 r0 h/ G( x% ]# W
'***********************************************************
: Q1 g* E* j2 Z1 sPrivate Function MakeTable(byval tdata) ( k9 A$ L9 _, h( X7 j& v; n
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"   J0 g- u# n6 `4 P: F6 U. J
   MakeTable = tdata 2 o( D5 j  q. ]+ Y- G4 b9 [' Y
End Function </P><>'***********************************************************
5 [8 Y* N6 B* y1 L) [& \; t''@SDESCRIPTION: Draws the Debug-panel 6 R; G% s1 y* P0 I
'***********************************************************   t" z7 O+ T- L5 }% ^7 j
Public Sub draw() % g' \4 n6 u+ x$ m5 J9 A
   If dbg_Enabled Then
- N& e; g" s$ C2 K- _3 h     dbg_FinishTime = Now()
% }. c; E- u- ^, x: S  
; s9 b. l/ T; B0 j) Q1 s   Dim DivSet, x 9 U# r# {5 E5 P& N! `7 O6 u8 S
   DivSet = split(dbg_Show_default,",") 1 C2 i% W- O: x; l' p" \2 T8 w
     dbg_Show = split(dbg_Show,",") + c# G4 X: @& l/ w' G  R% T% x6 [
  ( D' i- c3 e/ Q( W
   For x = 0 to ubound(dbg_Show)
  X7 t$ ~- x* O+ ]1 R     divSet(x) = dbg_Show(x)
5 |' W- \' P, h0 j% j   Next # f0 S) n# I0 k5 _
  
1 Z  G0 d$ W; C/ W6 `  J/ t   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;"
% T' W/ e' r! w   Call PrintSummaryInfo(divSet(0))
. N. {$ h' [: M; T' {     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") * a5 g' O/ }" B. Q
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
# z& `: N/ y9 Q4 p& L    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
' r8 u  `" n3 B8 Z    Call PrintCookiesInfo(divSet(4))
- u/ A' O) r. y9 t, F2 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)) . a, k6 x" [$ R: [
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 Z" o; Z  ]9 E: S' L4 X    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 3 i8 k4 y3 K; q- a
    Call PrintDatabaseInfo(divSet(8)) / A& X! J- }# u1 O$ f
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
/ z1 x( n! Z8 y3 f2 t3 O( P! d1 A    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
% G( R& M9 j" E+ Y    Response.Write "&lt;/Table&gt;" 6 p2 m8 n; t5 Y& k, I6 t
   End If 8 ^4 n! g  K* _' S
End Sub </P><>'Destructor , n& r; x. i9 _. i: U3 F; Z+ g5 b
Private Sub Class_Terminate() , O" |: D" }; f7 Z3 E2 m& p' j: \
   Set dbg_Data = Nothing
8 C2 J  W8 f( }2 ~0 mEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><># G- ^# E9 x; V- g8 |# |9 `7 _
CLASS debuggingConsole . [2 d0 n6 ^" W6 A+ [% f1 i$ k  z3 i/ r
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 Z3 s# g6 ~% e, j+ R4 I1 D/ r&amp;n$ T4 ~' P' @4 d
bsp; 1 q+ H6 ~- r0 y7 u- d+ ~6 b3 `
Property Get Enabled===[bool] Gets the "enabled" value
& W5 ?  C7 I! \, O: L  . R+ S0 ?8 |. p% x
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 9 e8 m( i4 [' _
  
) n( m" Y" q2 G; ?Property Get Show===[string] Gets the debugging panel. $ ^: C2 \5 Q5 N# F: r: L0 {
  5 @% e9 z: s( Q* D" n9 V( s
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><>-------------------------------------------------------------------------------- 3 W  ^6 I& g! Q
Public Methods </P><>public sub===Print (label, output)
& P1 P& p8 T" K- D& k6 |   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 6 a, U2 e8 g- b" v
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
; \0 M6 O$ [; x: `) M: e  `( f) H   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ; a2 V4 T4 Y! p0 \- _$ W& V
Methods Detail ; k3 E# m% |# Q. i
  
0 ]" X, Z3 A1 npublic sub===Print (label, output)
. ]/ k6 |4 t. m+ `' l9 yParameters:  / g4 F" ]$ _. {2 W* r# y9 R9 s
   - label [string]: Description of the variable
& E& ?9 w4 [% C% K   - output [variable]: The variable itself & w0 x1 [! E) k5 y. V7 w
  + F0 @! z1 J6 ?# K+ Z
public sub===GrabDatabaseInfo (byval oSQLDB)   U5 j0 N# f$ X4 a9 H
Parameters:  ' ^2 I' I# }! 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-10-15 02:37 , Processed in 0.443297 second(s), 57 queries .

回顶部