QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>& A; o, B- W- F; _1 k% T! H
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
# i  O+ }, d9 N( x使用方法很简单:
; \5 {' f* g. a4 @8 R; @7 Mtest.asp </P>: f. L8 k, j6 d) d2 P
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
: v5 K6 q1 v4 W* ?; l6 Y3 ^$ K&lt;%
) u# T9 F5 [2 o4 [6 _: {+ }output="XXXX" 5 s; e9 k& j: G- @% a
Set debugstr = New debuggingConsole - u# c! ?- e& J4 {
debugstr.Enabled = true - U5 d# f/ d7 _, m/ n& @
   debugstr.Print "参数output的值", output
( f9 Z! x" t! G2 Y   '…… ( I2 Q: x5 W, |) U3 @
   debugstr.draw / G. s2 N3 O3 F" [
Set debugstr = Nothing 2 ^8 r  B% c0 |+ x
%&gt; </P>6 w0 `8 a0 Z4 R% R
<>=================================================== </P>. `9 h2 G8 @% p
<>debuggingConsole.asp </P>
2 H5 M' K4 p# e/ h<>&lt;%
2 N/ _$ P, G% o: }Class debuggingConsole </P>2 ~7 K& d" o" o1 C9 ^
<>   private dbg_Enabled
5 b5 _4 Y3 Y: |- F: }- L   private dbg_Show ' L/ e, P* m8 E' {
   private dbg_RequestTime
+ ~4 ]2 o# Y3 v9 ~3 [- H$ C   private dbg_FinishTime
* A$ [2 L" ]4 F; Q9 ]  V   private dbg_Data ! e2 F0 v# o. F! X1 A8 G
   private dbg_DB_Data
: l4 B% y0 p9 |# T  F2 }7 L- O   private dbg_AllVars
) S7 [5 b2 ?1 I   private dbg_Show_default 7 R% y9 o" h2 x; _9 e
   private DivSets(2)
$ u4 F4 W0 P# n! b   
$ K1 G, L5 L7 R% k% t4 f6 P" l'Construktor =&gt; set the default values
  E: |+ j  h" n/ x! LPrivate Sub Class_Initialize() " a9 e. }" f/ G
   dbg_RequestTime = Now()
  u- q+ |) U; X0 x   dbg_AllVars = false 1 z; k  o* E' h& N0 l! v
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
5 R/ C5 p; I- B6 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>) u+ I: T8 b7 y3 {
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;) D1 f: `  p% ^4 r. G
&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>
, k1 F) x  l* [, A: A7 o9 P6 O  s* Y  j<>   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>1 y9 }0 O2 G6 n7 w( k
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" + j2 S( d; K$ Q  g. @9 o' v, K1 S
End Sub </P>6 o  b; q- [% }/ X1 g" V8 u
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
9 F: i  p2 ?# l   dbg_Enabled = bNewValue * F( a, M& B& R. a; Z2 v( n
End Property </P>  _# y# j/ b- D) _5 N/ p
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
8 a: X0 q& O1 w   Enabled = dbg_Enabled % O' f# T5 Y1 n* j% h
End Property </P>. S  z: {$ o7 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 # f% [% f1 I3 [6 ~4 |
   dbg_Show = bNewValue : q6 @% E  F) N# Q" o# T. ^' s
End Property </P>
: p  E  n4 e5 Y<>ublic Property Get Show ''[string] Gets the debugging panel. + j: ]& O/ ]( [4 C) d4 O9 f
   Show = dbg_Show
5 F/ a2 E3 C8 ?" O4 aEnd Property </P>* O5 H, A5 D/ J) i" E( o6 g
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
) S/ e% e4 _6 O* y# s   dbg_AllVars = bNewValue % Z7 X2 q7 d1 R) n
End Property </P>& _) f0 c: C$ R0 N5 a, |3 y
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
* ]0 w; s2 x% p1 k: M0 I   AllVars = dbg_AllVars $ _6 E6 X& M* V' I+ ^, X$ b
End Property </P>; P% |6 v( g) B+ E/ J  o! B7 ^
<>'***********************************************************
' V% }5 ]5 u" [  {) c7 d''@SDESCRIPTION: Adds a variable to the debug-informations.
* e) e2 \) @3 S. o9 }6 t5 U) i''@PARAM:  - label [string]: Description of the variable
$ B2 w' S, ]/ v# P0 t''@PARAM:  - output [variable]: The variable itself 9 \1 y/ _# A( {, s
'*********************************************************** ) p8 T# S9 C0 ^; s/ r1 x+ g# x
Public Sub Print(label, output)
" t. I3 R3 I+ @# L2 \   If dbg_Enabled Then
* \, d5 F4 x- v2 E' O     if err.number &gt; 0 then
" u- ]1 ?" h; ]: e2 ]: o       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
  d/ K, g6 R( H+ _; p$ ?: Z* [       err.Clear 7 \# d2 p% r; M( G1 N
     else 8 P% v; D+ {/ L) ?$ k/ Q
       uniqueID = ValidLabel(label) ( w; J( ]8 ]" T' q% ?8 I1 N
       response.write uniqueID 1 k) r. L& \% G7 G
       call dbg_Data.Add(uniqueID, output)
( e- T0 t+ |! u7 `- w) i     end if
: p2 V, B1 ?; H% X   End If 2 G& ?. P* C5 H7 ~
End Sub
! \/ e# @9 i* x9 b2 j  
% E5 c& Y" H. M9 u) S'*********************************************************** / I3 C% v0 w6 ^. a$ @
'* ValidLabel 7 b5 o" Q0 b0 l* h1 M  h
'*********************************************************** 3 Y) F1 |* J* j1 x, x
Private Function ValidLabel(byval label)
' @' B" I: t- L) [   dim i, lbl - S* ?6 W1 W. V
   i = 0 : H! h8 g  D/ b4 z2 s; N0 A
   lbl = label
1 L) ]1 C3 |( D9 a9 d   do
, Z- W; D* E, g, B6 c   if not dbg_Data.Exists(lbl) then exit do ' T( y' u5 x" j% q6 X
   i = i + 1
4 o% F0 L6 m6 x" f1 Z   lbl = label &amp; "(" &amp; i &amp; ")"
3 V+ Q6 P% G1 z3 i& A4 A- d   loop until i = i # Z& ^6 ]# `& V" e9 y- S0 _0 _
  % M  W/ I# h% P2 H; p0 C
   ValidLabel = lbl
, g% L. @: ~5 W# cEnd Function ! K3 l2 f$ c2 r) b; {/ Z9 ]2 B0 ]" o. O
  
. b# P1 }  q8 Q$ D! r! I'***********************************************************
" {/ N2 B  n5 `/ M; y'* PrintCookiesInfo
" `2 _+ s' v) b'*********************************************************** ) `' w8 I7 ?4 o. M
Private Sub PrintCookiesInfo(byval DivSetNo)
' ~. p) g/ \; s1 k   dim tbl, cookie, key, tmp
! o! d; n8 H, t& C$ \6 y/ o& H   For Each cookie in Request.Cookies
1 Y: y6 {* t, }   If Not Request.Cookies(cookie).HasKeys Then ( h' j$ D( w% a* |4 @5 L
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
* S1 Z) W) u& E2 u, [7 l/ r   Else 4 o9 e$ q( K' R- R) D
     For Each key in Request.Cookies(cookie) % |, |% w: N7 j* j
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. % }$ y  s7 H" U% M/ b$ ?. p0 @- x
Cookies(cookie)(key))   # w% y: O0 D" Y# L% x3 U) _
   Next , n, S( E1 Z- B' w7 o0 E9 H
   End If
6 `8 P* G% k, D( |* c& I( H   Next </P>
5 \) M8 _' n8 J) R6 U  w<>   tbl = MakeTable(tbl)
! a& b1 k" d4 w( O$ m. J   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 2 ]) T: ^2 M" T, ~; o8 x
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)   S) {+ ]) n9 r6 \5 I' q
   Response.Write replace(tmp,"|", vbcrlf) + m) M  }9 x* U5 u$ t7 O2 g
end sub
  Z  Y5 f, _# z4 C" i# w3 K# a  * H% }$ m7 {0 M
'*********************************************************** 0 j$ w8 p0 \) j2 T4 K4 m
'* PrintSummaryInfo . w7 O0 e3 i) @3 r* w0 u) V
'*********************************************************** " D/ Z& I& d0 T9 D7 p) q
Private Sub PrintSummaryInfo(byval DivSetNo)
& E6 M6 R5 R5 Z1 h) Y* r0 }  D   dim tmp, tbl $ n' H% Y% W  x9 `
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
5 M$ N! [) Y! R0 F0 f   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ; M" \7 T- C! {! H1 J
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 H) C7 z4 w3 Y+ v& V8 ~4 N   tbl = AddRow(tbl, "Status Code",Response.Status)
0 Q: u9 |( P, t. s" b   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
5 I& ], \9 c$ F8 r$ u& Y   tbl = MakeTable(tbl) ) f3 H+ g" J8 o6 l& t8 s2 m' u' z
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) # v2 h6 d+ l9 h. u2 I1 p! ^, `0 g
   Response.Write replace(tmp,"|", vbcrlf)
% y! W$ q5 i* PEnd Sub </P>5 }% U9 B0 l5 V' V2 O
<>'*********************************************************** # o& M! m7 ]! ~/ K) U
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& Z8 r! T  F5 o) I8 G1 p''@PARAM:  - oSQLDB [object]: connection-object
/ z4 o0 |& I" W. G'***********************************************************
7 ^9 C( f' e+ b8 Y9 S6 ~6 vPublic Sub GrabDatabaseInfo(byval oSQLDB)
* F& n* h; [* x. u   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
% F% O- ]' o% p; ~; _$ f: }   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) # z$ p5 s3 {6 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"))
; y7 S5 S' G9 J   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
' M3 @7 N" S& O* IEnd Sub <>'***********************************************************
- N& Y6 S' }- j" X'* PrintDatabaseInfo 1 b8 u: R1 [" a1 h
'*********************************************************** 1 s. e: ^+ C9 t! }
Private Sub PrintDatabaseInfo(byval DivSetNo) + S2 }4 n& b/ n; S) c
   dim tbl 0 R. m" A5 u1 z$ A! `( P* o
   tbl = MakeTable(dbg_DB_Data) ! G; r; F: k, H5 `! X. @) W# O; f, j) t3 N
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)   h# U+ T' e, v- l5 \
   Response.Write replace(tbl,"|", vbcrlf)   |# d+ W1 ], t6 k; a) o. a' R
End Sub </P><>'*********************************************************** : C7 F- p1 k+ m  A4 w6 @/ i( `
'* PrintCollection
0 p1 i3 K2 x2 }" ]$ x'***********************************************************
" R% g  v* L" B$ ~( H9 f9 IPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) , L+ S5 @) U8 ?# h, c  \" |7 P( b
   Dim vItem, tbl, Temp
7 z$ `5 E: o0 c( R$ H   For Each vItem In Collection - E" @6 a. Z, g; @4 W" ^4 V2 c+ }
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ' ^9 X/ i* E* _5 v& C1 B  Y3 ?
       tbl = AddRow(tbl, vItem, "{object}") ( |! T( h+ X! Y* r) ?; B
     elseif isnull(Collection(vItem)) then $ V* u# o; _' ]( n
       tbl = AddRow(tbl, vItem, "{null}")
( A( C: l- p  `( {. h( x! A2 F     elseif isarray(Collection(vItem)) then % c( D9 u: C" \+ Y
       tbl = AddRow(tbl, vItem, "{array}")
  i; `8 ^8 E0 N9 R* j( V     else
" T$ T8 S, L! b' z+ p& ^       if dbg_AllVars then ! j' z0 V8 M4 P9 ]: h  I
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
) S2 ~( Z) l: h* g) b     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then " d7 Q  r2 F: P4 _- M$ l
       if Collection(vItem) &lt;&gt; "" then + z1 g; m6 i4 x8 P6 }8 }5 |
       tbl = AddRow(tbl, vItem, server.HTML2 K! B0 s9 K  E9 V2 x
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
$ u  `" O6 g4 j       else ( D! E, z/ n2 ]1 X. A! f3 o
       tbl = AddRow(tbl, vItem, "...")
' \2 d7 L2 h/ G+ `/ t. y       end if 2 F% B8 V9 }2 z) J9 f- W
     end if
/ W" J# ?  t3 f& M4 `2 m+ E   end if ; M2 [, u( a$ E2 m
   Next
" z4 K9 ?& O$ }' C/ m# V   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
% a: @- i; T& x3 V# p0 I! D) J   tbl = MakeTable(tbl)
# ]4 F: k1 C6 M8 z   if Collection.count &lt;= 0 then DivSetNo =2
$ c6 `$ y3 f/ ]; u& w     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ; y. j$ J# l+ G4 ^5 B& D( ?
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
7 U/ Q7 q6 U+ D& |. [$ X  u     Response.Write replace(tbl,"|", vbcrlf)
7 o9 c' m' N! O6 A) wEnd Sub * V2 M+ H3 c4 \6 @( F5 |& W
  0 C, [3 w# A/ n8 Y1 g2 `- K* C
'*********************************************************** ( p5 X* ^  P- g2 }# Z& v7 U
'* AddRow
( O$ A. I, c+ C- R1 @" k'*********************************************************** 1 y, \4 x' w( i5 |% Y$ f6 u
Private Function AddRow(byval t, byval var, byval val)
0 G2 Y2 h. I4 I. {+ {9 r5 u   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
6 F1 |% V; o! L: g7 J& D   AddRow = t
( b# h2 |8 ^7 S5 gEnd Function </P><>'***********************************************************
. Z& U) F+ p/ k- W# g'* MakeTable
/ F6 K2 A: d7 z' \7 a! @'***********************************************************
9 a/ J  O% S& F1 x) o  VPrivate Function MakeTable(byval tdata) 1 {* a  z- j0 q' o
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
7 O, ~% T. r" k0 b: ^$ T/ U- X   MakeTable = tdata
$ d9 L! e* X! y& AEnd Function </P><>'*********************************************************** , k8 ^: Q/ ^; D. l
''@SDESCRIPTION: Draws the Debug-panel ( N# Q+ K6 [8 j8 K8 E% A7 K# N
'***********************************************************
% }7 ]8 q4 \8 G3 W. i* m# hPublic Sub draw()
7 e: F" W1 [! B9 U* X7 x' Q   If dbg_Enabled Then
& r% O$ s2 H5 r6 W. B% |3 V: C1 N* G4 B     dbg_FinishTime = Now()
* d* b2 S% c( P$ y* c  
1 _. I' }" `' O: D" d4 a   Dim DivSet, x " T! h& b# o8 @+ p
   DivSet = split(dbg_Show_default,",")
/ K+ f4 N  h  [- V: V- e' m     dbg_Show = split(dbg_Show,",") # k& b: G& M( J: a
  
, b/ M0 p2 s1 f# l   For x = 0 to ubound(dbg_Show) % d2 ?' P+ ?4 H2 E% R
     divSet(x) = dbg_Show(x)
. D* e, a: V6 C  K   Next # ]* K) d6 g! \9 D/ b
  
1 X# O) B  ^- J2 X( `+ 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;"
& x2 b$ v' A/ ~- l* c4 c2 J   Call PrintSummaryInfo(divSet(0))
5 Q! n+ ~! w8 K6 w# Z! l% H     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
6 j2 g" A) x' x7 x1 l& `- y! V8 H    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
. Q& w8 I) O7 S$ B5 P2 c    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
; ]8 M7 d9 V# c9 n    Call PrintCookiesInfo(divSet(4))
: W3 [# B- z# d) a  d    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)) 0 j4 G1 B% i" p5 g
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 9 W9 C  \( r# s8 L# U
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
4 @% ^' i7 i1 `7 p9 X5 G$ D3 r3 c    Call PrintDatabaseInfo(divSet(8)) ' d9 h) W# U; |5 T0 R4 f# D
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
% O& w$ w  t3 R2 v    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " q0 R, O' {9 t+ w5 L* K9 W- g
    Response.Write "&lt;/Table&gt;" * O7 \' ?5 _. _( F; X: }  R8 w! I
   End If 3 k8 f! |0 U( E
End Sub </P><>'Destructor
5 ?( [$ `* D2 o7 ]% mPrivate Sub Class_Terminate()
* Z$ T8 D; f! y5 k' {6 o* ~9 W   Set dbg_Data = Nothing ; e2 w  o+ L2 d+ F6 }) @5 r
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>( [$ S2 Q9 T6 m8 n
CLASS debuggingConsole 9 S( W4 n6 m& B) [
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . y8 [& A4 [! r5 P& C4 ]: j; n
&amp;n
, ^0 Q, _9 I$ G  E2 bbsp;
! O2 k8 {$ e  C3 z; k( A, zProperty Get Enabled===[bool] Gets the "enabled" value 5 J3 ^4 [; }# x* F1 v9 v5 _
  
5 l1 L" H0 d, W" K, R0 S6 {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 8 @7 D: t+ x. G! ^
  $ D3 K1 n& [, m. }* A
Property Get Show===[string] Gets the debugging panel.
. U7 v/ _0 j3 a$ c1 M- k  ' z' E$ ^7 I  n! [
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><>--------------------------------------------------------------------------------
; n- Z' l; E5 N' o# aPublic Methods </P><>public sub===Print (label, output)
  A. s6 }1 B4 y7 A, z   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
: i: x' w* ]5 C& T  F% x: d   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 9 N2 h, l, y0 y, G( l7 N' o
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
2 q9 t7 k3 H+ T' @2 [Methods Detail ' t0 K4 @& I7 L1 q& t0 R
  1 I2 T) i; Q, H. c
public sub===Print (label, output) & m, Y/ c: D& f/ K! \$ r
Parameters:  4 X1 ~2 `& F  c9 X! d4 s% T- R* V
   - label [string]: Description of the variable
& N4 h0 U4 l+ w) j   - output [variable]: The variable itself ( ^( t2 l+ n7 h- p
  . P5 o  H; I% J- r
public sub===GrabDatabaseInfo (byval oSQLDB) 2 h4 S, X5 x, z5 v7 e' R
Parameters:  9 g' R5 P+ B2 [1 C$ q) W+ T
   - 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-7-3 12:13 , Processed in 1.076041 second(s), 56 queries .

回顶部