QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
& B3 M' t! b, t& L5 M7 P<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
2 |* X: i8 j4 `% o使用方法很简单: . p0 I, I, ]  d& C( k$ T* G5 a
test.asp </P>; s2 a2 k, Q) f: T' r0 Q
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
) y; ~7 ]4 [8 u- v  w3 ^&lt;% % ]3 S' _8 D& C  p4 [
output="XXXX" + _; [- b& g# B' c, u& ~' }
Set debugstr = New debuggingConsole : ]9 s5 n" F- |$ [. J- C
debugstr.Enabled = true
" t+ u/ o, s' r' S( F5 H6 \   debugstr.Print "参数output的值", output * q# G( T; ]/ m4 f0 z9 r+ R+ D( l; D
   '……
/ l0 A, S( T1 N- H   debugstr.draw 0 p* M- t. K9 G, I# P# [
Set debugstr = Nothing 5 K0 r4 d4 _" p
%&gt; </P>- B4 o/ M5 o' V  C: x
<>=================================================== </P>
6 h: f# s' y. ]<>debuggingConsole.asp </P>6 _1 ^7 c1 o( z0 n$ @; r
<>&lt;%
! a5 n5 X( h0 L7 z0 A- Y) PClass debuggingConsole </P>
* V- m3 e$ A) N! A$ O<>   private dbg_Enabled 5 h8 X* V1 u2 `1 K8 n- h( e
   private dbg_Show
; W7 v# }' G3 J& u9 t   private dbg_RequestTime
" b- v0 Y4 p& t* u* ]   private dbg_FinishTime
; w9 z1 f+ y( _' ?1 P. c  j/ [   private dbg_Data
2 J- C5 c) V6 r/ c9 y   private dbg_DB_Data
. C# q  v8 M/ Y) I8 z: O  r   private dbg_AllVars # Y7 U8 R1 e! N3 _) i
   private dbg_Show_default
! O) ^* F! q; a; k2 d2 w   private DivSets(2)
  I* t0 ]" M; X. m! \   $ W3 p$ Y+ w# d1 D1 V% W
'Construktor =&gt; set the default values - f1 U. t& }. S6 h: v
Private Sub Class_Initialize()
( f5 W: f  f. J$ {7 H   dbg_RequestTime = Now()
: }, `  a( X. m/ O   dbg_AllVars = false
; A% B. a7 f& w( |, Y3 A0 G, o   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
6 D5 @9 j) O, l6 T# ]* f<>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# s! q* Q- V6 H# B
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;& f, g" @; B! U! |9 r- H0 u, ~
&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>
0 ~: b! Z$ b* s4 R: n% [/ k<>   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>
( H, l, Y* ]1 l0 s$ x<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ; P) ^( e( h9 }
End Sub </P>
$ S5 B# {8 C/ j# S5 X4 W( _) {<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
/ X5 z- S) N5 t   dbg_Enabled = bNewValue # U4 R. S2 I  C0 c
End Property </P>) J" M0 J; P" u3 M* r
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value " [7 z  Q6 M: n2 [. j( c
   Enabled = dbg_Enabled
2 F" b0 _2 C- lEnd Property </P>
; v# Z9 }5 [) S% T# h<>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 e. N  V; L; N; o
   dbg_Show = bNewValue - ~7 T& }7 R! k" g* j5 ]* d
End Property </P>$ P8 `5 u# f3 ~/ g
<>ublic Property Get Show ''[string] Gets the debugging panel. # o0 T. V7 h  h' ?. h
   Show = dbg_Show
" {  z0 C0 O  Y% rEnd Property </P>
8 n+ c$ F, A" f$ {<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false % G( ^0 n% r& \/ h
   dbg_AllVars = bNewValue * Y8 q8 V- Z% T. }
End Property </P>8 Y2 w% C5 W0 M) s6 t' v1 m. W1 |
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
4 K0 S/ f5 E- q& h6 L   AllVars = dbg_AllVars # q0 ?5 J# H0 Q' i
End Property </P>
8 a+ h0 X! K3 {( `6 O<>'***********************************************************   q' e: R2 z2 |! m# q/ x# v3 ^  d
''@SDESCRIPTION: Adds a variable to the debug-informations. 6 f5 D2 F$ E1 `# o2 D0 f" n8 e7 s
''@PARAM:  - label [string]: Description of the variable
! L3 \/ h2 q' f1 O! s''@PARAM:  - output [variable]: The variable itself
- J4 C4 X" N3 l& _2 p7 Z'*********************************************************** ) E4 h* x9 D) H7 m
Public Sub Print(label, output) # e2 S& d) g* s6 C6 ], p
   If dbg_Enabled Then / G. v. w: V0 T' j
     if err.number &gt; 0 then : C1 X+ J1 k1 _3 B# f
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 2 W1 B( y( i/ ^  z8 C* Z
       err.Clear
( {$ b. z$ i, \6 G     else
+ k( q) v8 X$ Y" g- ^       uniqueID = ValidLabel(label) - W$ b( p6 T3 d! N
       response.write uniqueID
8 r) b7 G7 l( z6 s: t       call dbg_Data.Add(uniqueID, output) ! d: H; E& ?& |& f! x3 L* |) h
     end if % W- X3 Y9 t! K* H9 S" M
   End If 8 {0 B8 p/ k/ H  C5 ~+ X2 y) @
End Sub
. R+ b) X5 W! J7 }) l  8 t7 w0 V4 ^  I, ?, |/ r: l
'***********************************************************
8 q0 w/ ~! `9 T: i. q'* ValidLabel
: @( b9 W; h  C) s. f1 G1 H'*********************************************************** 9 L, ~" s4 D- T3 J6 x3 H
Private Function ValidLabel(byval label)
! @0 D* b, r! W. ?, D1 O6 V   dim i, lbl ; D, b8 Z) m8 j& }( p- p( r9 ^
   i = 0
" C6 b1 |9 K7 e, \. V/ \   lbl = label
: T# S. z3 Q2 ]   do 9 \. k: Q$ K9 Z
   if not dbg_Data.Exists(lbl) then exit do
. A- |0 A% `% A( e, S( o# J6 H/ ^" Y8 w   i = i + 1
+ l: J5 W+ \7 W5 l2 {7 Z/ P   lbl = label &amp; "(" &amp; i &amp; ")"   O% x: u% K, R$ z% d* {
   loop until i = i
: `0 p6 e- o- g$ J/ j1 s( A# T8 ?; d  8 P6 P3 m  q: t4 e& I
   ValidLabel = lbl % i+ p' v+ ]# g+ }8 w
End Function
6 f6 T) e+ A. `* l0 D  
: K6 n2 f7 C& p. L( A. P1 |/ U1 h'***********************************************************
1 B+ {5 O, C/ q( K& i' s'* PrintCookiesInfo
3 c' v; j0 _  k- s'*********************************************************** + ?$ ]  W7 J8 @* L+ V
Private Sub PrintCookiesInfo(byval DivSetNo) 3 A& R1 q5 Z$ v1 [* o' |
   dim tbl, cookie, key, tmp
1 s: |. p3 C, ^, c( a4 D& _) J   For Each cookie in Request.Cookies 1 c( S) x" p3 H' c1 i+ h
   If Not Request.Cookies(cookie).HasKeys Then   @# A  ~& q9 B. A$ i5 i# b
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ! A1 ]% n5 H# h! o
   Else , \6 c' U0 D# w
     For Each key in Request.Cookies(cookie) 8 S9 r! M# R* h* c! O* \
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
- x0 i% H1 V' MCookies(cookie)(key))   % I) [: M$ Q6 x( x- i/ t
   Next & s+ p/ u7 V8 [3 d+ \! C
   End If
/ `# @' I: o) t( X+ f   Next </P># d) o0 m9 K9 o/ i" {. |
<>   tbl = MakeTable(tbl)
- g- o( s! f; ^" R0 }( U0 h   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
! J3 I; B; H. s   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
- M4 I; X3 T4 L/ |6 f' ?- A% u   Response.Write replace(tmp,"|", vbcrlf)
( |6 z6 ~: Y: nend sub ( Z$ \. b( {7 l' V# Z1 S" P
  
4 n, c- C4 E2 B1 y0 i" l'*********************************************************** 7 D2 O7 u+ f/ y* W7 ]8 U
'* PrintSummaryInfo & f$ J0 ~9 U* T6 D0 W; ~$ G5 f
'*********************************************************** : ^1 W4 ^$ s6 b4 y' q4 G# i( P# ~
Private Sub PrintSummaryInfo(byval DivSetNo) * d6 h! l* k4 f; Q% m2 }+ Y* Z  T
   dim tmp, tbl
* X$ r- X6 [/ i5 i, B- q: `* }6 R   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 8 S' Y% B- u4 H. F$ d
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") % J. d. ?: L  J3 v" A9 z
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
" G4 G: `. q, V& a- r' H   tbl = AddRow(tbl, "Status Code",Response.Status) : b5 t) z# a3 E
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
# ?( @+ C; C0 A1 `  _   tbl = MakeTable(tbl)
/ u5 _/ ~, }) a   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) * |; A4 U  Y3 p, H) W3 _& i
   Response.Write replace(tmp,"|", vbcrlf) ! {/ M8 P# h& m
End Sub </P>
" [' d. K3 L$ l<>'*********************************************************** ! h" s: @0 W( @! u0 V6 \$ h
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ! I8 b! ]$ ~' v2 T
''@PARAM:  - oSQLDB [object]: connection-object
3 t( ^- U# d& j/ v/ D( U'***********************************************************
$ D: y+ y1 v; iPublic Sub GrabDatabaseInfo(byval oSQLDB)
* W. \3 X$ Q; g5 r8 F* J0 Z   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
+ }9 ], v; a3 k  D2 _: y   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ! c, z0 O# |8 \4 A& v
   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"))
7 u2 q' O  U4 B& M/ [6 g6 K2 l* d   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
& _' o3 |9 U; \& K( B+ A0 vEnd Sub <>'***********************************************************
$ d' c" h/ k( x+ V& A9 @'* PrintDatabaseInfo   q( p, ^8 x& Y. ^1 N4 v+ h3 P, w) R
'***********************************************************
4 n/ B9 _1 t8 m/ ?! K7 b8 XPrivate Sub PrintDatabaseInfo(byval DivSetNo)
5 y* ?9 b. h" ?9 B; Q0 M) b   dim tbl ) A8 ~. v: o$ N- [+ n4 X
   tbl = MakeTable(dbg_DB_Data) , A4 e- \& k$ Q
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & ?+ e8 ?! F9 t
   Response.Write replace(tbl,"|", vbcrlf) 2 q* A% U1 p2 Y6 F- a
End Sub </P><>'***********************************************************
5 L( ~9 _4 @' C' {3 ?' s; x( {'* PrintCollection ' W4 Q  A! J4 [# t/ E9 P
'***********************************************************   g$ c0 \! N/ f0 H' q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; V0 X/ `8 \, F- Z
   Dim vItem, tbl, Temp # ?( g" Y/ l9 w6 o5 u1 D
   For Each vItem In Collection
1 d' n4 Z! M  [- Q7 R! C0 {: B! J' F# p     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
, ~# c& r# ]8 ?       tbl = AddRow(tbl, vItem, "{object}") 5 X4 ]2 p% i2 ?6 O# ~/ M9 X3 ?2 ^
     elseif isnull(Collection(vItem)) then
6 J$ V2 Y9 T7 X       tbl = AddRow(tbl, vItem, "{null}")
6 y) [5 \& Y$ k$ s5 G, h     elseif isarray(Collection(vItem)) then
1 l3 {9 Y; b" O* ^       tbl = AddRow(tbl, vItem, "{array}") 7 p' [& {' L* q' E, m; C1 c
     else % J% h! J" u- M0 O
       if dbg_AllVars then
* b/ g( c. C+ F% |& f       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ' i6 N6 Z9 \, `% {- c# J0 |5 j
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
( J3 f/ C% z6 L& C1 X" O# j; h       if Collection(vItem) &lt;&gt; "" then
2 h; ?! K* p5 t8 H% J+ t       tbl = AddRow(tbl, vItem, server.HTML
" L0 z8 t+ K" QEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") - L, B( z  t4 S- L
       else 0 C3 n) t! B& t- _3 ~7 r5 c1 L
       tbl = AddRow(tbl, vItem, "...")
5 y2 u$ L/ |, Q9 |* Y8 P5 v' X       end if 3 [. @- f3 L7 u7 ?
     end if
0 ~1 m: e# h5 c, Z; P   end if ) b( v9 \( e0 w0 t% Q, J
   Next / U8 K# }( v' X0 p4 k  `$ M6 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 9 Z2 u! s! P8 [
   tbl = MakeTable(tbl)
$ o) T! F9 O3 O3 C/ Q   if Collection.count &lt;= 0 then DivSetNo =2
0 G5 y, F/ ?; U. c     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# {2 T& b, x4 u+ q     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% u2 \- |( T. n  M3 G     Response.Write replace(tbl,"|", vbcrlf) 1 H7 O' k5 p' M# x. {  S
End Sub 4 P6 o& A5 t( D' H( G4 O
  + V: x0 d1 }6 b: j  |" Z) s
'***********************************************************
9 }. X8 y4 b' l2 a& o'* AddRow
$ g9 Q' m. t* V% H9 ~4 ?'***********************************************************
2 ]1 @# I. m  ?8 _7 o# zPrivate Function AddRow(byval t, byval var, byval val) ! e$ x, K4 b1 S' R9 f+ h
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
  x1 s8 T- J6 [2 o% V4 b   AddRow = t ) u% y& o. L4 ]9 M5 @
End Function </P><>'***********************************************************
  E  {) g# U  g5 H! Y6 h'* MakeTable , [* \# O: S& [/ G
'***********************************************************
; ?" U/ n# }! w, f" pPrivate Function MakeTable(byval tdata) & h! ~" K/ s$ r0 Z7 Z
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
# p0 R" o% S5 X# |0 p( M   MakeTable = tdata
6 q$ o. {% S1 i7 d, G: E4 KEnd Function </P><>'*********************************************************** 0 f5 I( T% }* h' V( X# C0 N
''@SDESCRIPTION: Draws the Debug-panel
+ ?+ \  j7 i3 B' F) C'***********************************************************
2 ?; r& _# r, V5 d7 J/ V6 sPublic Sub draw()
" R- v5 c% |7 L$ n1 s! H4 Y   If dbg_Enabled Then
( w. v5 H: S' R* Q& q     dbg_FinishTime = Now()
+ F) I) ?4 [+ H2 ?  i, ?8 P% \5 N+ E  n  ; l) X6 M5 T! B8 _5 A, ?" B
   Dim DivSet, x
* l7 D9 `& r! m' X- |( E$ N+ J/ W   DivSet = split(dbg_Show_default,",") 1 N. L6 k, M3 Y1 p9 Z
     dbg_Show = split(dbg_Show,",") . s. E# ]$ d; E6 i2 \% Y
  
- g  L8 l2 b' n   For x = 0 to ubound(dbg_Show)
4 P5 X) s* H& ~( H     divSet(x) = dbg_Show(x)
: q* D+ T0 E' M' g   Next
3 ~* k+ @! m2 ^6 J  ]) m0 ?# p  
% o. c/ n) I6 }) M# i   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;" ' F1 E$ S! d# W6 Q
   Call PrintSummaryInfo(divSet(0)) 2 \0 g$ O4 c& W$ @4 J; b3 ~, \
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* P7 ]+ C; O3 w& t  P    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ; H8 o& N/ |. y4 I0 j0 w/ c
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") + j0 {, r0 w; `# t8 N
    Call PrintCookiesInfo(divSet(4))
# Z, O8 N4 o. V# ]) K% q    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))
2 w# n1 @6 ~$ I    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" C  {1 U+ A8 G& y& J    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( a- P' W- N8 H$ I
    Call PrintDatabaseInfo(divSet(8)) : d' M8 b: s- g0 Q/ h$ \
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
, y8 \  i& i7 T    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
9 S8 k' A( Y9 w% `! m    Response.Write "&lt;/Table&gt;"
1 Y- G1 O+ i  c+ m5 f   End If
6 u5 w$ L  K# U% oEnd Sub </P><>'Destructor
) B2 `9 R4 f' O$ Z, E) xPrivate Sub Class_Terminate()
$ u9 T# n; U# b. A   Set dbg_Data = Nothing # q  K3 d5 H: \! n
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
3 D, o8 p5 C3 \5 n/ j1 vCLASS debuggingConsole
* r8 }/ b. I) o/ s# kVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false $ u6 h* M. b2 `& e
&amp;n! ~% j5 t" K+ m5 L1 J7 \
bsp;
. m/ c' b- Y, A. J2 u1 ?3 pProperty Get Enabled===[bool] Gets the "enabled" value
4 q6 A/ N% H) G/ T3 ?& U  
% Z' o+ j/ N5 E2 V+ KProperty 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 1 R5 y+ C! R3 W2 m2 w6 m
  " U9 o/ T9 b, V* C8 P  R
Property Get Show===[string] Gets the debugging panel.
. V0 }# Y" _/ B. R- X% X, Y  
% V2 b/ t/ l, cProperty 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><>--------------------------------------------------------------------------------
4 Y: c2 I1 j/ ~6 g+ oPublic Methods </P><>public sub===Print (label, output)
" @, U: n9 H) P4 ]1 r   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
6 k& G+ p. Q4 g5 T+ d" b   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
  k" {! b8 s8 F, V   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- , s# _, ?' |  ~) q2 J' v: L" t! e
Methods Detail
' O% J0 f- R+ n. @' Z2 k: S* Y  : X6 w. V1 J5 a
public sub===Print (label, output)
+ i) `8 L" ~8 ]6 O  iParameters:  
3 u- \# Z0 n* ]   - label [string]: Description of the variable 1 m. F/ ~0 Z7 M5 z9 ]$ A, y& M2 B2 N
   - output [variable]: The variable itself
* O( N0 c6 k( @) v0 B  
9 F. |: |' ?0 E, T) p- ^public sub===GrabDatabaseInfo (byval oSQLDB)
0 a' f3 n$ _! J- S& G0 w0 oParameters:  
0 W5 b! Q  P) m8 U5 t) j( C- N   - 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-1-13 11:23 , Processed in 1.258733 second(s), 56 queries .

回顶部