QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>: h9 M( {& E# C+ |1 h  M4 D
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
& K, f9 w5 [" X4 ?4 y4 F/ w使用方法很简单:
+ R1 @, W/ d; c" H1 X+ k7 wtest.asp </P>" {) c6 m2 h) _4 U+ L* C& R$ S7 v
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
% ?, \) A( a: \&lt;% & T2 _+ q$ Q2 y& V
output="XXXX"
" r3 x+ L9 y" m& w6 j5 ESet debugstr = New debuggingConsole / d8 Q" B( N, u5 C3 |1 y) U
debugstr.Enabled = true
- v) q) H' ?1 j7 Q! k0 R* `( a+ ~   debugstr.Print "参数output的值", output
% _2 O  z/ M( z" A7 p   '……
: E5 ]4 m- k/ S   debugstr.draw
4 r1 u2 j; Y# K1 ~2 N; RSet debugstr = Nothing
! P, c  B3 L- W7 x%&gt; </P>2 U0 }3 G7 b: r
<>=================================================== </P>% I' Q* Y3 G1 z; I
<>debuggingConsole.asp </P># m' |0 N- c. G! W& ]( u3 f" K
<>&lt;% 8 ?3 L/ u- a- \7 y2 A) b) I1 n
Class debuggingConsole </P>
' S" E; p$ a+ C* t" ~7 ?<>   private dbg_Enabled
4 @7 f* C" ^! G: i/ {! K0 L   private dbg_Show
- s' I+ R/ v7 I4 M4 ?% Q* _$ `   private dbg_RequestTime
$ Z( Y# C0 T  Q) [2 L( t   private dbg_FinishTime 4 d, F0 e$ u8 f7 k1 l9 y: _
   private dbg_Data + b. {6 p5 a  E4 b/ w& J2 N
   private dbg_DB_Data
- B5 ]% R" @9 c1 N& k3 {   private dbg_AllVars
9 a( C5 T) F! V* e" X: e   private dbg_Show_default
; c" h2 a9 ]8 B9 {  T   private DivSets(2) $ G) U8 V3 \/ o4 N
   
- |. V. _! `: T; j'Construktor =&gt; set the default values
% ?0 R3 c. R& o$ v( APrivate Sub Class_Initialize()
+ N6 ^$ A& L) S9 M   dbg_RequestTime = Now() ; ?; _$ \5 l3 b% m( q" S
   dbg_AllVars = false 4 J; g! O9 H/ S% @6 m
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>' J7 e, O7 B) r: ?
<>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>/ p4 ]' @4 T9 W  `) `
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
! s5 n/ ?  G1 I; @! }1 b: g! R&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>+ I( N  h* G( n- O
<>   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>
4 I  v  U5 E0 K0 u, n<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
; y$ F* |0 D! h0 ~5 _9 XEnd Sub </P>/ k0 ~7 h5 y. c9 k  o/ z; X! g" t
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
$ d- M  ]. X4 z" b* }6 R, g; J: A   dbg_Enabled = bNewValue
3 W& B7 G( U7 S$ T7 J' `1 SEnd Property </P>7 _% Y1 Y3 T1 y; N) w( g* j
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
5 d9 Q7 g" T# c7 Q1 a   Enabled = dbg_Enabled
1 A) n6 J: P& A" q# qEnd Property </P>
  v* I3 k. }) c* y<>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+ g" \2 N8 d6 y' n- `( V: E
   dbg_Show = bNewValue " _+ ?; w. ?" Y5 x
End Property </P>7 e6 O/ ~% N- O# y
<>ublic Property Get Show ''[string] Gets the debugging panel.
8 a, k2 {% c; n9 @8 t- c+ [3 F5 p. h   Show = dbg_Show
6 d9 I) V) A8 \. ~4 V. |; m: c# ?End Property </P>, \4 z( x; s5 b" _& A
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
% W* }. ]9 U/ p1 C" V$ L3 U8 X   dbg_AllVars = bNewValue : Q6 P5 O8 ^: X7 U7 L. ?0 m
End Property </P>2 V& B' V/ L+ l/ I& _8 @7 w# E
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
( ]  D3 Y" ~" i   AllVars = dbg_AllVars
9 o* M- K- s! L* K( |8 I6 mEnd Property </P>
5 N3 L' n$ P/ h$ N, O<>'*********************************************************** 4 v1 S& K1 k: W
''@SDESCRIPTION: Adds a variable to the debug-informations.
6 ^+ F- i2 x+ c# |''@PARAM:  - label [string]: Description of the variable
  j/ J$ s2 `" b' z+ i6 S''@PARAM:  - output [variable]: The variable itself   t* w2 Z- K9 E" S3 l' {3 l3 [
'*********************************************************** # k$ ?. ]) L3 E/ @1 F- }
Public Sub Print(label, output)
. O  X. X* t9 V" b! S   If dbg_Enabled Then " N! S  z* z' {$ ?7 e9 U/ B
     if err.number &gt; 0 then
2 s" a9 Q! G; `( z, T# v- g       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
, V' F; U+ P/ g7 K8 A! P" }       err.Clear
8 W- M& c( w' e0 ]% O     else
' P( ]+ b6 R7 a" ]8 b3 S" ?       uniqueID = ValidLabel(label) ) u: \% z: B1 p2 O' u7 h
       response.write uniqueID 8 E% k7 M! B" B+ d& F; {2 R
       call dbg_Data.Add(uniqueID, output) " \& \/ r) z/ v: O
     end if
5 T" r2 `! D. h3 y: c. q   End If
. M, H9 i0 ~3 w) T; X0 qEnd Sub
- t' n) f  ~" u4 x/ f: o" t  / I- ^' A& J* x9 Y7 z7 K# y& j1 w
'***********************************************************
/ J( E  @/ t& S' z4 L: I'* ValidLabel
6 S: I8 U9 V: x3 `  P# [" ]: s'***********************************************************
, d) ~  Z# @! W' vPrivate Function ValidLabel(byval label)
. i+ W! ~( C- z, n0 u  z   dim i, lbl ' \3 Q: S4 `) {8 D" \
   i = 0 6 c3 R( F2 a; D" k9 @
   lbl = label 7 X# u5 W* D" e4 L8 x% z) v
   do
3 j2 Z% {: S- I4 ^# K+ \   if not dbg_Data.Exists(lbl) then exit do
4 \: W/ m# b; }# w8 H& H  J# B   i = i + 1   R! J% F4 z# A9 C
   lbl = label &amp; "(" &amp; i &amp; ")"
* E: n' o2 o4 r$ D" F& z   loop until i = i
' {/ u7 P7 O+ t9 {; V9 P" W& H  
6 p6 y: t" W3 K% w   ValidLabel = lbl 8 y. Q3 ~) h; @2 M9 p! {! J8 z
End Function
3 H) o( U& ^6 q. @3 G5 y  
# f9 ?1 a$ t, M$ W# e* F'***********************************************************
/ Z. L0 Z/ h( S! |" f' \. z'* PrintCookiesInfo
; I" x7 [7 z1 K5 z/ P7 Q. h'*********************************************************** ( O# e$ E$ d6 M2 X- _
Private Sub PrintCookiesInfo(byval DivSetNo) * S" z% @% b* O( |, \$ E' v
   dim tbl, cookie, key, tmp
7 T; @; p- Z2 x2 I5 e+ \3 i9 t   For Each cookie in Request.Cookies & u& X4 O) j3 _" _0 f9 L
   If Not Request.Cookies(cookie).HasKeys Then
; Q  s8 F1 F  m     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   & h3 B2 y, J5 H  H3 U3 ?
   Else . Y. G5 U0 w% L, I/ N
     For Each key in Request.Cookies(cookie) " [8 i2 ^% D& p
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. & {6 r) s! t, \  Q4 m
Cookies(cookie)(key))   8 o; Y1 S$ U! O& i! I- p! \. ?
   Next
1 r$ h7 }3 U2 T% ^   End If 3 Z: F) ^6 I" v, U
   Next </P>7 x6 W9 D1 L- p4 w' s* q
<>   tbl = MakeTable(tbl)
5 b1 o4 s7 T, t( H* {   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ; e+ W5 h& _& W1 L8 h* V
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
2 ~! G4 d" \5 u   Response.Write replace(tmp,"|", vbcrlf) ' m5 p+ r) I) L
end sub
# Z, a$ O9 A; P  
, y" P4 o, y# i# x# p9 }" I# j" }9 ]'***********************************************************
, t0 n! Q. V7 t% i'* PrintSummaryInfo 9 o- C& h8 g2 O
'*********************************************************** " y) M3 |' U! E4 T" L3 \
Private Sub PrintSummaryInfo(byval DivSetNo)
& I  f. g" }0 o   dim tmp, tbl " _, k0 ?6 A6 E* B# c
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ) h6 E. Y3 n" e% z! ]0 T
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") & R9 z7 w2 S3 [( v8 Z
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
5 l3 x& K4 @/ c. U5 O6 k! T( u   tbl = AddRow(tbl, "Status Code",Response.Status) ; D' L, r  k" }6 |3 o) F0 o
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) $ d0 D4 g- l& y$ J
   tbl = MakeTable(tbl) / u6 j  e8 G* }5 r3 s
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) " A! E* f* U) h- {
   Response.Write replace(tmp,"|", vbcrlf) 3 M# L4 J8 N5 l9 w4 z7 R, w# m- i7 K
End Sub </P>
5 Q5 u; K* u7 y- _! v<>'***********************************************************
  E5 Q. z( S' B$ z" i''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information . C7 Y# S' ]2 H( f* ^5 f3 F9 r9 V$ P
''@PARAM:  - oSQLDB [object]: connection-object ; k" P8 J5 M- l5 q1 X
'***********************************************************
  u2 X! C, P4 R. C; ]  [. @Public Sub GrabDatabaseInfo(byval oSQLDB)
7 z4 x9 \3 ~' `3 W: K: X' D8 t9 ^   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 0 M7 s) R$ j  x. I  f
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ) ^. C3 Q( J! 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")) * p5 q! s1 X% g$ {+ x, ~/ Z
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
* i0 Z4 g0 A$ \+ KEnd Sub <>'***********************************************************
8 Q- p% l- f( B% v! _1 T'* PrintDatabaseInfo - y, v' P. R+ f* l4 v
'*********************************************************** ) ~- W! T% r& G4 H
Private Sub PrintDatabaseInfo(byval DivSetNo)
7 H) a  T' F3 Q1 t/ k8 T) E   dim tbl 2 e  z6 ~. y3 R5 x
   tbl = MakeTable(dbg_DB_Data) 7 ]) v; `  d- y. z/ h
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 9 j/ E& c7 ~( i) P# o1 R" y
   Response.Write replace(tbl,"|", vbcrlf) 7 ]) D/ k7 j( U+ z) z
End Sub </P><>'*********************************************************** " G; R) L+ r: i7 {! ^) x% T
'* PrintCollection & V$ ?8 i) U2 m( p
'*********************************************************** ) M5 p/ t; X, L/ O
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& a3 x& F: b( Y* n   Dim vItem, tbl, Temp ! Y  Y0 {( H' f4 v
   For Each vItem In Collection * A4 Q/ A. g* a- C
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ' K/ D& f7 G/ {, D
       tbl = AddRow(tbl, vItem, "{object}")
5 p9 J- ]1 t9 p$ b     elseif isnull(Collection(vItem)) then
' x) R: P1 \  {# m8 ^0 ]       tbl = AddRow(tbl, vItem, "{null}")
: P4 J" j: [) v% u     elseif isarray(Collection(vItem)) then ' w6 |3 _+ `# b9 B
       tbl = AddRow(tbl, vItem, "{array}") , i: U$ _: F% I, K2 t5 k, n
     else
2 g9 g4 L- {8 q9 \: X& W& `! n; y       if dbg_AllVars then
/ ]' k9 N3 }+ C' x) Y       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
+ e  R- A; N( e0 F. e: l     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
6 L# O( |  s# \3 K9 M       if Collection(vItem) &lt;&gt; "" then
; M& j- @/ S& F! }' Q       tbl = AddRow(tbl, vItem, server.HTML9 G5 R6 B, u, T2 g+ q1 j$ F
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") + ?$ E0 L. s' c6 A, y  m" ?* l
       else
4 a2 i# }4 q) t8 P       tbl = AddRow(tbl, vItem, "...")
2 X% P1 Q# |, T: c4 j       end if 9 @( F; X2 L6 X
     end if
' j& {/ [* \  f2 X+ t   end if 3 X0 g& i" ?( d. O/ H9 q8 L
   Next
% a; k5 D# t2 P5 s3 o   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
, q/ O3 j5 U) X   tbl = MakeTable(tbl)
- e) d7 c9 a. l* [   if Collection.count &lt;= 0 then DivSetNo =2 / }9 D+ o5 {9 H4 D2 s
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
4 u- @% K! V% `- A8 Z0 v     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ i. H9 E& R1 s$ x     Response.Write replace(tbl,"|", vbcrlf) 4 w& i) v" v8 P$ r4 [9 [
End Sub
3 {+ @6 C. W) D2 w  
' S# o; a" }8 P'*********************************************************** 9 J' q$ g( `( q. y6 h0 {
'* AddRow   X) ~0 ^3 ?1 W3 k# _1 [
'***********************************************************
2 T3 j5 P' m! G8 c# w4 IPrivate Function AddRow(byval t, byval var, byval val)
5 b% n7 n8 }% r6 I6 w7 R   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 0 x0 s: y; }9 W2 q
   AddRow = t 2 i6 c7 \( @( r% r
End Function </P><>'*********************************************************** 3 V2 I; |( t# Y6 ~* Y
'* MakeTable
" t4 j$ I3 ^( J( J'***********************************************************
; x- p) s6 N4 L& A" @Private Function MakeTable(byval tdata) 3 s2 ~0 w; c: @2 r
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 8 Y( `* P0 j7 O: A# d
   MakeTable = tdata
, p/ e; S6 P5 p8 x0 xEnd Function </P><>'***********************************************************
9 |1 t# g6 P) D( v+ k, |9 d+ i+ Q''@SDESCRIPTION: Draws the Debug-panel
5 X! `9 q% f) z0 W/ ^$ x5 A3 {, T'***********************************************************
, k* {& J: q- w5 b. H, BPublic Sub draw() $ G( q2 E+ t/ d3 T& O  e
   If dbg_Enabled Then
1 c! ?2 u; z% u, q8 E     dbg_FinishTime = Now()
$ I5 _; L0 W7 [2 ~9 d$ [  7 n% j7 J4 V. _+ f5 O
   Dim DivSet, x 8 V  w* G+ j( U0 h
   DivSet = split(dbg_Show_default,",")
' {! D. b% F) ~/ A     dbg_Show = split(dbg_Show,",")
1 s$ L9 J+ a* F- p! S  
& J0 H6 v( z7 |   For x = 0 to ubound(dbg_Show)
+ g. r6 C/ K' }( a. }     divSet(x) = dbg_Show(x)
' e+ K2 p/ y: {5 r) T' ~, H& w   Next 1 t+ o0 A4 h  w) W( h
  
8 w2 o3 {  M/ u, K( m3 j   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;" ! G% Q6 |( S( K* s# m1 ]
   Call PrintSummaryInfo(divSet(0)) 1 D5 E  \. e3 s$ k$ E/ a/ H
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 b) s; ]) m1 c2 {# j. F: P
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
6 |8 R) `, R  q3 W" B! i    Call PrintCollection("FORM", Request.Form(),divSet(3),"") - o0 P, @0 Y, S. Y, v
    Call PrintCookiesInfo(divSet(4))
8 W0 v3 `* r- R" s( K    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- c" R7 H2 e0 b% C5 b5 |6 _    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . Z7 m. A+ E) c4 c- a
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
, p& |6 q7 d9 n/ r" V* e# z" l  s    Call PrintDatabaseInfo(divSet(8)) & E" M1 x% y3 m" k; r
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( g) p0 O& W$ j5 ~# q$ v    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
9 h3 t# Y; e1 J! ~. F4 ~    Response.Write "&lt;/Table&gt;"
3 L; S5 s+ B6 Q+ f, A4 j, X   End If
4 p1 F. [3 P1 ?End Sub </P><>'Destructor , @7 g' J1 I1 f
Private Sub Class_Terminate()
" H. V. b* y) L! q7 @& N0 |2 p8 C   Set dbg_Data = Nothing * ?3 \( L" Y( v
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>/ a3 _6 b3 S8 s
CLASS debuggingConsole 2 x& p, }& t: T6 h* a! ]0 N
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false : |7 ~/ b! y- N- x' d% {
&amp;n6 y! D3 P' {" d" t3 N
bsp; " b. C: b( }% F+ }
Property Get Enabled===[bool] Gets the "enabled" value
* Z8 p3 }4 f  X7 l( P; K- A  8 h- {' H, g. L4 v2 A
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
/ K( [/ B! g4 B, L& z  A. G5 A  ! D1 D' ?7 t+ O$ ~# F6 s. T
Property Get Show===[string] Gets the debugging panel. - ^2 C% u6 p2 M+ r1 r, s
  0 q5 q' _. o7 E9 b( w% ^
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><>-------------------------------------------------------------------------------- - ~' h" D- d+ p" ~( Q, [0 }
Public Methods </P><>public sub===Print (label, output)
- a% W& Y. t/ |' s/ O. e   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
1 N& E# n  C* e) S3 n/ L   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () , \7 R2 L" X4 ~1 M) w7 Z6 _' u
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
. {9 Y8 m4 r) y% K% n+ q; Y/ ]1 zMethods Detail
  W5 M! y8 E/ ~1 i/ s  ; I1 @4 W4 @' O1 L: y+ p
public sub===Print (label, output) 0 R2 ?, M! d% j. _! q5 B' z. V. e
Parameters:  
5 n7 S9 y  X, w7 i3 j1 K# R   - label [string]: Description of the variable
3 a2 H- R; h: M1 j2 s   - output [variable]: The variable itself
2 t$ |3 \5 L: T7 L) ^4 a( R% g  {  
6 j% R8 c5 D) U& o. q9 T( \. r& X/ F( Jpublic sub===GrabDatabaseInfo (byval oSQLDB)
) g/ i: p8 ~5 W3 h# X0 JParameters:  2 g4 R) D! l% |
   - 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-11 06:46 , Processed in 1.290924 second(s), 56 queries .

回顶部