QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>  y" n" _6 h7 @" \1 g! S
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
+ |; O! Z' H) o# T# x& ]3 `使用方法很简单: 4 n" Y, d+ v5 Q
test.asp </P>4 \1 p. W! C& [
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; : n" }/ E! g/ ], b: ]! N( G8 ], J# H
&lt;%
6 T  o' I* V: O2 P; boutput="XXXX" ! G4 ^1 K- B2 k4 H9 v0 g3 l6 H1 e
Set debugstr = New debuggingConsole 9 \* \8 r+ T) [* a8 p2 c6 P/ P( A* [
debugstr.Enabled = true
% }5 f' d7 ]& t) ^, ^) K   debugstr.Print "参数output的值", output
" J2 J/ A  e) P  t   '…… % [4 [1 m2 @* \, L5 F: H) u
   debugstr.draw ! r) F' n& \* }( y; u
Set debugstr = Nothing 2 c3 E7 d5 M* x; S" X% A
%&gt; </P>, w# k9 D/ w3 p( w& o( Z6 G/ Q
<>=================================================== </P>
* a7 u3 l4 Z0 b2 t6 p<>debuggingConsole.asp </P>
" Z2 N& }: O$ A( V<>&lt;% % \: y5 V& W$ ~: w- ?2 G) w) W! @
Class debuggingConsole </P>& g5 Z) v9 h+ ^% O) X
<>   private dbg_Enabled
% j( C/ y1 R' `* a/ V- O   private dbg_Show
: w1 X9 P2 J" p$ Y) T   private dbg_RequestTime
; ?3 t5 ^& T  O* u- l3 p8 C/ t   private dbg_FinishTime 7 Q: c, f4 T3 J7 ^, k
   private dbg_Data " H7 T8 s/ Z' H9 n+ k; X
   private dbg_DB_Data 6 V1 P, x. p. l1 ?. D2 w; t
   private dbg_AllVars
- z1 D7 C: B( I   private dbg_Show_default
! _7 e; ~# l8 ]8 z. g  J0 o+ t0 S% _   private DivSets(2) % I9 Y2 T5 \! X5 e9 Q$ o0 k
   0 V- F9 p7 C4 m& }
'Construktor =&gt; set the default values
( v0 [  k; Q& s/ Z/ BPrivate Sub Class_Initialize()
0 V- [4 F) i  s2 [   dbg_RequestTime = Now()
# x0 C8 i/ w9 x! I   dbg_AllVars = false
6 B* S7 U# X: O% e   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>0 G, T5 ]. w% C9 X" i2 z
<>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>& r  p4 }1 T' C6 y5 l
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
& S: b5 v) C5 }, h8 \. ^3 Q&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 H) R: y4 {4 y; U. S<>   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>
# f8 z8 d" O  L1 l! S$ z<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
$ w0 T# [0 J# r: \: w) XEnd Sub </P>
) _5 Y+ W. F: i8 R$ p<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
1 W1 m3 B6 r6 U+ p1 q6 J   dbg_Enabled = bNewValue / `7 k8 d" j- v& s7 q
End Property </P>  I+ M, a( v  Y# Q% R
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 9 A. c  `0 c- X: P7 o
   Enabled = dbg_Enabled
. I4 o9 M5 B! h  a$ C: x# ~End Property </P>
9 L! ~5 f! o' a% x<>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 - t( O% c$ i- S& h
   dbg_Show = bNewValue
: |" r& `9 S* _0 I1 \4 s# hEnd Property </P>
. A- W, U& M- J# y! Y! \<>ublic Property Get Show ''[string] Gets the debugging panel.
. b4 z5 z8 G, U# [4 Y$ ?   Show = dbg_Show ! t, F* @( {" [4 p) u( G4 O$ P" S' C
End Property </P>, s" H2 a1 G. I3 K* `
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 5 T: C! A6 j2 j
   dbg_AllVars = bNewValue % i  q1 g2 _  {5 t' c/ ]
End Property </P>
+ M9 G! C2 C: M% p2 x* R<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. # m- F% ?- m9 y3 h4 i
   AllVars = dbg_AllVars ; B1 c# |& A' W8 }4 [, m% L
End Property </P>
6 U0 T& z7 u* x; h6 z0 p9 c<>'***********************************************************
1 ^. f% Q  b5 U''@SDESCRIPTION: Adds a variable to the debug-informations. 1 h2 x& y. e. g. `# g
''@PARAM:  - label [string]: Description of the variable + Z, @  J/ n3 f* D
''@PARAM:  - output [variable]: The variable itself % x# }7 Y/ E' @
'*********************************************************** + x& J9 H# r, H9 C( o# n
Public Sub Print(label, output) 0 I8 i* _& N* w( F5 v
   If dbg_Enabled Then
/ K9 f0 ~3 E: y& p0 I2 j     if err.number &gt; 0 then
8 }0 ?* ~$ o4 d7 V0 g       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ' w( t( ~4 u3 h9 {7 J
       err.Clear
8 X* Z) R& D$ T8 E     else ' v/ s4 x+ S5 D" G! F7 b0 N) G/ `
       uniqueID = ValidLabel(label) 9 ^% @+ A6 ~& M; S& N; d0 f% j
       response.write uniqueID
, h+ T4 k, x3 h  b       call dbg_Data.Add(uniqueID, output) / X2 e, {, G" V/ A; {1 m
     end if ( d$ L; a: N; k$ g* h" a
   End If
% P7 D9 o: E) O0 O9 {End Sub
2 _- i6 W6 o- K' J! y9 d+ |  & S6 f9 o8 _  A$ V6 V
'*********************************************************** ( B7 c% K8 z4 z+ S5 w5 Y1 H; N
'* ValidLabel
" K7 I- y6 p3 w'*********************************************************** 3 \/ o6 e# a0 C/ k
Private Function ValidLabel(byval label)
2 D- [9 S9 C/ k2 ]( v   dim i, lbl - K% f  e/ {! \$ \1 ^- n' L5 i% ~4 ~
   i = 0
" Q" z$ V( F# Q* ]   lbl = label
7 m4 t, O. D. E* [$ J# S$ p: a   do 9 R4 p( W8 @( X! N  d
   if not dbg_Data.Exists(lbl) then exit do
  M6 }" j/ {. q; |9 a   i = i + 1 4 ^. L8 f9 O" f/ P2 |
   lbl = label &amp; "(" &amp; i &amp; ")"
" B6 k/ _, \: _  F, Z! H% |  F& l   loop until i = i
+ o9 r, O' J, `8 e$ n* B  # S# e- ~' ^4 G( Q, j
   ValidLabel = lbl . W% R) r6 M+ E; N: T4 c1 ^
End Function
" b; U) r( i; m0 m1 M  
2 `" h, n; l( N- \$ z( `, L'***********************************************************
, i" e1 S' I% h0 T'* PrintCookiesInfo
5 y/ m8 N/ i- M+ B) p+ J1 Q0 V'***********************************************************
" N( d) S% {. K8 ?) |  @Private Sub PrintCookiesInfo(byval DivSetNo) ( W( U: N5 z5 G' t# D/ @+ q
   dim tbl, cookie, key, tmp 0 ?6 R, v9 H6 Q2 l1 ^
   For Each cookie in Request.Cookies
7 Z$ l- E; ?4 U# l4 R3 k   If Not Request.Cookies(cookie).HasKeys Then
* |( p& f( Q8 O! q; V1 ?: d     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
; _: X6 D9 L. d, l   Else 8 H' h1 P) l' v& f% Q, ~- h
     For Each key in Request.Cookies(cookie) 8 W1 s9 X: `: a2 Y( X& {
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 4 @' j/ ^$ z( V
Cookies(cookie)(key))   
3 q1 g$ f1 E3 N9 Q0 E/ L2 s& T# D   Next
9 A! _  b$ m: G: Y  q! y. }3 \( {   End If
+ n0 |+ x& C" k   Next </P>
& j/ M* K! \2 r+ b0 w0 Y<>   tbl = MakeTable(tbl)
$ X8 B" m& k3 M$ \+ \. G; M   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 : {) l6 @6 g+ M& P
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)   D2 Y- x8 ~1 R2 O. R& J8 X- }
   Response.Write replace(tmp,"|", vbcrlf)
; Q6 J1 U, T7 t) Qend sub
( T9 |, d2 S! B( S9 m  p+ B1 n7 h6 h; D$ L  
; Y2 X" R* i7 m  t" g* T7 y! ]'***********************************************************
% R( {( y2 I: c  e'* PrintSummaryInfo . C( r/ K+ R; e4 D7 z' Y
'***********************************************************
! H5 R$ }' B0 ^3 f1 PPrivate Sub PrintSummaryInfo(byval DivSetNo) # M. V7 z1 Z) }8 \7 B4 U
   dim tmp, tbl - ~1 A) b6 ~+ u2 `. B
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
- G! D) ]. i$ j$ C+ Z+ {& f: D# ]   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 1 @' x6 y. u0 `& t
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 2 k: \& |, a1 m  h5 q0 _) a
   tbl = AddRow(tbl, "Status Code",Response.Status)
, ?/ _2 W  d; M% }/ d9 y   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
* d3 {7 u+ q# v5 x5 q   tbl = MakeTable(tbl) $ N, C) p- k  f# d
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
9 l2 ^. \# Z) {* g6 ~' }1 b   Response.Write replace(tmp,"|", vbcrlf) ) t* @1 @2 d8 ]- Y; y8 n9 O' s
End Sub </P>
5 q' D5 M0 i$ O" K$ y; I0 k7 W<>'*********************************************************** . V' I7 \$ H9 r  Q% g
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information $ S! l2 t; O* q% U0 M$ O' p
''@PARAM:  - oSQLDB [object]: connection-object
+ ^7 F! u6 z7 V: t. O4 ~$ s'*********************************************************** ' x) ]4 q. |1 u, j0 E
Public Sub GrabDatabaseInfo(byval oSQLDB) : ^1 j% W; }- F/ J5 M% J* S4 S4 G
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
7 b* u: }" y# y$ A   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 0 e  p& _" O3 {, ^+ ]
   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"))
# b% d) m" w" u4 f% a) y  z   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 2 A, u$ U$ q( ^
End Sub <>'***********************************************************
9 b8 N( ~. A% U/ c) C'* PrintDatabaseInfo
  u! p' w# z9 L5 a'***********************************************************
8 N) g' @( k# A$ vPrivate Sub PrintDatabaseInfo(byval DivSetNo) 3 V+ b7 t# m' E. Z+ R# G
   dim tbl 2 t" q" k% S0 f' y) c
   tbl = MakeTable(dbg_DB_Data) % x& J! |# Q: z! E4 O$ u. n6 c
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 _, d; W8 Q: U2 Z! N/ U) o
   Response.Write replace(tbl,"|", vbcrlf) / a: T/ B1 \# q2 L& q' k( J
End Sub </P><>'***********************************************************
; u% k3 J! f9 l'* PrintCollection + @3 s: j1 t4 u, S9 b' |
'***********************************************************
2 k' O( u4 M$ e8 wPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) . h: {1 [6 |" {9 H0 B5 }  ?
   Dim vItem, tbl, Temp 2 K# d( Z5 i5 A9 y) E2 y2 F, }
   For Each vItem In Collection 1 |% u" I2 o# k' J
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
2 l# P: d9 Q' \4 P/ Q3 [4 |7 w       tbl = AddRow(tbl, vItem, "{object}") * ~$ r$ \3 N3 _. P
     elseif isnull(Collection(vItem)) then
: I& r: C$ W: w' S* u" Q/ X3 l/ ^( v4 {       tbl = AddRow(tbl, vItem, "{null}")
* y, P9 a9 {% o! h     elseif isarray(Collection(vItem)) then
; p' j, Z# ?$ V4 W1 h- N9 h       tbl = AddRow(tbl, vItem, "{array}")
& C+ g0 P8 w. J     else 8 q" X) `8 w: N: G9 d$ R+ [
       if dbg_AllVars then
1 s3 d3 L9 O1 F& Y+ A9 a2 _( m! T       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
* M1 ?1 ?+ K" j2 n: z! |     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
1 K- v) w" g! X; b; f       if Collection(vItem) &lt;&gt; "" then
1 Z1 o" ^" \, c% U) o. t) @0 J       tbl = AddRow(tbl, vItem, server.HTML
5 y( r8 |8 X* Y& h9 a6 Y0 x' sEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 8 y- F5 A* M2 T1 n2 r' I
       else 5 L7 H# q% N0 Q1 }5 g1 i& z  {
       tbl = AddRow(tbl, vItem, "...")
; ]- {: }: J& }+ _7 L# w3 w       end if
' U* w5 z+ a: |/ }# N$ {     end if
+ K' L- z9 |2 g: r   end if , U8 E: Y0 @3 N
   Next
6 v. _& Q  S9 {% p* n; |   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
7 @) Y( G7 f' ]  H  l* o, ~7 H   tbl = MakeTable(tbl)
: h$ d1 ?. Z" N) Y7 ]   if Collection.count &lt;= 0 then DivSetNo =2 9 _, g" \, I! p4 j9 u
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
- r* c) Y' o$ b     tbl = replace(tbl,"#sectname#",replace(Name," ","")) " o; h! X: w- o" H) @- `
     Response.Write replace(tbl,"|", vbcrlf) % y, K1 ~. V6 }- `, E; K
End Sub : V+ g* ?/ M5 @: j2 @* Y
  9 X1 |3 c* n$ n7 d0 L
'*********************************************************** 0 w" C# k2 A3 c5 {
'* AddRow ) C( j/ u( q" ?
'***********************************************************
2 ]5 j7 W: p- u3 \Private Function AddRow(byval t, byval var, byval val)
  o  O) E9 M1 ~   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 6 v3 Q$ \" L+ s1 B
   AddRow = t + j# L) [2 N0 Y6 d
End Function </P><>'***********************************************************
; W6 l* F. K- p) C: y, ^8 v& f'* MakeTable
, s( `' W& |" S+ `$ U4 ?1 V'***********************************************************
. y7 v" [8 R% Y9 @; z, Q$ Z; FPrivate Function MakeTable(byval tdata) / }& [: l$ y1 r) f( V" g
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" % Z! A0 S8 P3 i9 W) N
   MakeTable = tdata # G' I* b3 T5 b5 {' o2 m
End Function </P><>'*********************************************************** $ Y1 E4 Z" \6 l
''@SDESCRIPTION: Draws the Debug-panel
1 ?0 a) K+ X* Q'***********************************************************
$ W: `& E7 O! Q$ MPublic Sub draw() + o* `/ R! N$ [$ a/ w4 ]
   If dbg_Enabled Then
" Z  _& `. v  F1 L/ u% l; Y     dbg_FinishTime = Now() 0 z0 |9 e8 {8 S6 _! t
  8 ]& u! j* w) y) }( g5 ]2 g
   Dim DivSet, x
& |7 G' Z! m" D# \   DivSet = split(dbg_Show_default,",") , B9 x& E* ~3 |9 L. S
     dbg_Show = split(dbg_Show,",") 9 D) I% B( x6 Q" M% L9 Y
  
! z. z9 t  X  h   For x = 0 to ubound(dbg_Show)
6 r. I% d5 A  l     divSet(x) = dbg_Show(x) ! L/ f! @  u+ v2 G4 B; k
   Next ; v, F5 U% J* l
  
7 i  n+ A1 M2 }5 s. M( u   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;"   N" q* R* b, Z8 w* X0 Q) s
   Call PrintSummaryInfo(divSet(0)) " X4 E& M9 v  y) I
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( Z6 Z+ M5 c( F& Q
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
! W" q4 `8 j0 h    Call PrintCollection("FORM", Request.Form(),divSet(3),"") * C  i! V5 t% ^8 B  [0 E+ j% K
    Call PrintCookiesInfo(divSet(4)) % z- w6 C& O" E3 I7 Y% |0 B
    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))   D* T2 q2 C) Q
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: P* `# ]9 h* N/ X    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) # n3 K# q5 |! \6 |
    Call PrintDatabaseInfo(divSet(8))
. p7 W) m& ^& n9 v( M& i9 e% V0 p    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") & s( o; E6 W7 G4 c  U
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
& f0 A+ W3 M/ C( m- }    Response.Write "&lt;/Table&gt;"
1 S' K9 L: ]) B   End If 4 M* A) \' r: j* l: u/ C
End Sub </P><>'Destructor 8 R( v+ T2 S) n. h: L7 N
Private Sub Class_Terminate() / [' x3 P2 B9 P8 O
   Set dbg_Data = Nothing
% b- K* K& b5 l! ]7 MEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
/ D! Z, l  r3 o, [* [$ SCLASS debuggingConsole
- _4 W! V& C6 U% qVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false $ ?! u- k/ G# h! }+ Q( J3 J
&amp;n9 H  ~3 t4 m$ v$ D3 G
bsp; ' I! \7 @& _6 h; H2 }/ X' G
Property Get Enabled===[bool] Gets the "enabled" value 2 E: r; n+ _  k  t3 Q! B9 |
  
) o4 d, R  D2 W# C. ~3 _1 MProperty 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
+ x# z+ U: J+ [, r0 H  
; Q' K9 P5 x2 ]* GProperty Get Show===[string] Gets the debugging panel.
" M, v9 v8 T# Q4 k  `9 o6 a6 ?3 ]  3 s6 V' a( k$ h  g( y  g. _
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><>-------------------------------------------------------------------------------- 8 {3 H- X2 U  f) G
Public Methods </P><>public sub===Print (label, output)
: g) z- v7 e# B4 j" J9 Q   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
* v1 `. u$ T5 `! M2 o   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
% V* W; L% g, Z7 D+ @8 ^, |! r   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- - e9 m! L$ Y! g! ~
Methods Detail # C: A1 c- E$ H6 c
  6 H; E9 u' B, P8 P8 U# I5 u
public sub===Print (label, output)
6 Q7 A! I+ f. A" [' B. q: lParameters:  
  O& f  {6 s: x& k( `  `   - label [string]: Description of the variable ( A% I3 t0 R7 B+ m
   - output [variable]: The variable itself * Z& T1 S8 C6 J0 ~: x2 \
  
9 V! o/ o9 v- p% ~4 Ppublic sub===GrabDatabaseInfo (byval oSQLDB) 6 h, l7 _  ]# V. g: i
Parameters:  
5 X, A0 Y4 R$ d2 s7 m   - 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-5-31 04:52 , Processed in 0.411609 second(s), 56 queries .

回顶部