QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
, R5 S5 c5 o( W7 c& ~! I2 e<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( b6 X% ]6 A) Q% I; S5 }2 _
使用方法很简单: 7 c' H' G9 I* ?
test.asp </P>
: X5 u! g5 |4 d$ v/ F$ P5 l<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
+ m) c) ~: p% D# B$ ^1 a) y4 p, f( D&lt;% ) Z# ?9 u; l( x, T7 m( h
output="XXXX"
, H! j6 ]- [- b. C1 vSet debugstr = New debuggingConsole
, [# `2 j& i' A8 Pdebugstr.Enabled = true
7 E+ x, u, ]  V8 n( c   debugstr.Print "参数output的值", output
1 K% L! [  S  h   '…… + ?' }9 f0 V+ [; i' i* |
   debugstr.draw
0 s$ W" u- I9 q+ _Set debugstr = Nothing
' e. T) Y9 g9 Y6 O6 Y%&gt; </P>0 |* E% |2 b5 t  v: w
<>=================================================== </P>
, ]( I, K3 i6 j. k* z<>debuggingConsole.asp </P>
$ O$ t5 U7 Q" ~: t4 p: A: v<>&lt;% & ^2 d2 @+ e: X+ S& G+ y
Class debuggingConsole </P>
! R4 n  u7 h+ ~" p1 m) N& a<>   private dbg_Enabled 1 X( X4 g* s; ?* _  w, W3 t$ Z
   private dbg_Show
2 `9 w+ V) C( O+ L! Y   private dbg_RequestTime % a, g+ f  ]$ u, r# {& n+ T
   private dbg_FinishTime
' F. v4 q. `# P9 I  a# E: f% `+ S   private dbg_Data 0 l$ F2 a( K% z' R9 f
   private dbg_DB_Data
) \  j( U6 o& p: E8 r  {" |: B   private dbg_AllVars 2 Q' t( T9 W- n  g' l, a
   private dbg_Show_default 5 v* ~& w. b" {* ^7 T
   private DivSets(2)
# L/ y9 |) O, V) C# O   
$ h, R4 S5 l5 _; o8 G  c'Construktor =&gt; set the default values
6 C8 y- Z$ t" _+ x& m" wPrivate Sub Class_Initialize() & x7 Q+ X# I: J+ d- K$ G: r
   dbg_RequestTime = Now() " N- [/ d; T5 U7 R
   dbg_AllVars = false # t4 o& Y. g2 j
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>& L5 f* Z/ Y' N
<>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>
- j; {/ W2 o* j5 J<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;# r/ ]+ L7 b: y7 [4 o, d3 b' M$ v
&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>8 d3 G: m, @' c6 ?6 X+ M+ E
<>   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>3 r1 s) X6 S' e% H
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" . H2 f2 U& Z) {% s
End Sub </P>
3 a+ c; i! [* f! k6 j<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 4 c$ S" ~+ H/ a  p3 T' v
   dbg_Enabled = bNewValue
; V$ s, a, n. \8 j, n2 P! p- {% yEnd Property </P>
5 P# u( \& V; y- K) j<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
3 |6 g( N9 L0 F   Enabled = dbg_Enabled : [. C& ?! T; \$ a0 w  e
End Property </P>6 ~8 w: N3 P: M
<>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 * v" ]1 h, n% O+ l& @
   dbg_Show = bNewValue 7 P9 s; f9 h/ w
End Property </P>
+ z) O4 v- B) C4 |! e<>ublic Property Get Show ''[string] Gets the debugging panel.
3 L! b5 @$ Y) Q4 v: U   Show = dbg_Show 8 C. @- t" T! w" d- \8 C, k8 Q( L
End Property </P>5 T% V7 d. z# p* C. X' s/ U/ C
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ; a4 ^, ]& \9 V, V- H& v
   dbg_AllVars = bNewValue
$ r; Q8 g+ I. u1 t! zEnd Property </P>3 F+ }7 S# I% k3 C* k$ x/ v7 v
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 2 _! a+ K9 W1 M  W5 z
   AllVars = dbg_AllVars
$ y( M# y) E8 a! ~: Q+ zEnd Property </P>+ Y" B/ S& F1 s- d- P
<>'*********************************************************** 3 W8 d9 s4 I& {" u2 T- @
''@SDESCRIPTION: Adds a variable to the debug-informations. , E0 C8 K- Z# [* f9 p2 d
''@PARAM:  - label [string]: Description of the variable 8 D& b3 q. d) G
''@PARAM:  - output [variable]: The variable itself
, N/ r& R. y1 T: m. U$ u'***********************************************************
9 C; W& U  C* m& IPublic Sub Print(label, output) " @5 A% h3 @# H, e- z8 K2 n
   If dbg_Enabled Then 3 B, a& P2 Y/ O  P( @
     if err.number &gt; 0 then " y. W4 B# Q, e! R$ _7 a2 a
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
% S$ x/ ~3 B8 U  g0 y       err.Clear
4 M' l. J0 D. T     else 7 ~9 E' Y2 e  _5 M# q
       uniqueID = ValidLabel(label) ) s' S2 ^% K: E; `. k
       response.write uniqueID 1 D8 ?7 \! \2 e% p1 I
       call dbg_Data.Add(uniqueID, output)
  G9 x& g% ^5 y& V, K* s) ~     end if
2 A( V5 D- n# |2 p+ r   End If
3 K! p0 ^4 n, T1 [' {( UEnd Sub
$ b! y' f) y, U, F5 y& P  : T8 p' c5 A9 O, S1 [
'*********************************************************** # F7 m$ M8 w" u9 @
'* ValidLabel
; m3 C' I6 a1 ?. W6 z5 o8 s'***********************************************************
5 t$ }7 @/ Q4 D" }) d* uPrivate Function ValidLabel(byval label) 7 l8 H, K4 x3 `7 L' f
   dim i, lbl - t1 w' a& I, y6 v, J: U6 z' {
   i = 0
6 i9 @5 e- S3 r0 O; Z7 u   lbl = label
: \3 E: ?1 p! r   do ' q: S, g3 l( t
   if not dbg_Data.Exists(lbl) then exit do
# a# v, S& I1 j   i = i + 1 : [/ C- C3 `) L+ Y( J( n
   lbl = label &amp; "(" &amp; i &amp; ")" % t1 p. ], W" G0 f9 |+ _- C
   loop until i = i
- {2 ^1 F# p" O" A$ [  [  R* Z4 L  , _" w5 [- L0 d# `
   ValidLabel = lbl
- E) `  {! ?; C; R$ G3 UEnd Function
! `& I0 J3 c" }6 P  `+ J  
1 s- ]; z! s' T, L# B/ K'***********************************************************
0 }& q7 |8 T! u% ]# ?, `; Y'* PrintCookiesInfo
8 q1 w1 z% f5 i'*********************************************************** + Q& P' H5 K$ g
Private Sub PrintCookiesInfo(byval DivSetNo) 3 {( |$ Z$ w8 z) {
   dim tbl, cookie, key, tmp
) D$ \1 j2 A/ h! D7 D; A   For Each cookie in Request.Cookies 4 H1 i# `, z- U: v1 f; C
   If Not Request.Cookies(cookie).HasKeys Then * m7 T% [) h6 f# E
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
: E6 Z- K+ a  v6 j2 {   Else , A9 U6 A% O+ b6 y8 \
     For Each key in Request.Cookies(cookie)
3 ~3 A& B# ^' P& ?  D     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 0 r3 U) |6 b& T3 ]+ f
Cookies(cookie)(key))   
  R0 h* X" c3 @, T' c   Next
9 N+ z9 z( S! Z   End If
  X" E( U1 l+ g. \* e' t   Next </P>3 Z7 B/ D+ E- w( m/ m) s
<>   tbl = MakeTable(tbl)
3 d) `2 S4 r+ X. u   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
6 z' ?0 J! j- j9 y   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 4 P' `" J  H( t! n
   Response.Write replace(tmp,"|", vbcrlf) % l1 u& A! f4 X4 _4 z; @0 m) H$ C5 t
end sub
/ G( `# i) K8 E6 r) s  
& Z; v3 N% c' j- E2 s'***********************************************************
' Y; H0 W  S# I& K0 L'* PrintSummaryInfo
7 L9 d$ ]  t/ s+ X& ]% v: f( \'***********************************************************
& B- I3 _, d. T( yPrivate Sub PrintSummaryInfo(byval DivSetNo)
1 C* w/ B* j! A9 m1 [( |  ?* e   dim tmp, tbl
  {3 c9 j& ~0 d* x5 a   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) # x4 n3 M5 i4 Y, e% C
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
& S& `- |, F" ~+ ?: f/ I' N   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) / j! g+ q- v. M
   tbl = AddRow(tbl, "Status Code",Response.Status) ; w7 _! I3 b9 U  j: n) D4 {
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
+ B) x4 l: m4 k; K4 z   tbl = MakeTable(tbl)
  o3 H! W1 O. W1 y   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
5 U$ Y& S* u# {3 W; A   Response.Write replace(tmp,"|", vbcrlf)
& H* N- g3 H" k5 \# n8 fEnd Sub </P>9 U$ b, o8 U/ H' B0 r- i& L
<>'***********************************************************
, m7 T8 M, Z& C! o' F% I''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
$ l& m: p, R7 @4 A; z; J! N''@PARAM:  - oSQLDB [object]: connection-object , p- s6 o9 R7 A* F
'***********************************************************
; K7 C2 `# d4 x1 X; @' b. PPublic Sub GrabDatabaseInfo(byval oSQLDB) ) V  ~1 |  h$ x
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) # y& _5 d* z2 \. ~, O- x) E
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
. S& e: F9 \& h$ F8 C+ p   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")) 5 n# H1 `1 V& x
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
. g! v1 P( |$ z' FEnd Sub <>'***********************************************************
4 `! S5 G8 ]& r3 `( D" M7 E'* PrintDatabaseInfo . [' F8 z# Y: o( Q
'***********************************************************
' I) C/ @% i9 r  PPrivate Sub PrintDatabaseInfo(byval DivSetNo)
8 G1 _; P% w' q( F: f% z   dim tbl 0 s0 a& H5 g$ f3 O4 }: \
   tbl = MakeTable(dbg_DB_Data)
( z* Y/ j0 y& c  l; S! X8 r) ?   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ( t" a2 a' h/ h* q! E
   Response.Write replace(tbl,"|", vbcrlf)
% ]8 v- H% r+ m% Z' JEnd Sub </P><>'*********************************************************** % v3 x  {# w$ N
'* PrintCollection 4 C, w0 k# H: \+ A) y
'***********************************************************
! y! u' C: J) c- nPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
' `$ O) ^, R; q' ?   Dim vItem, tbl, Temp 0 W; F/ M; b- B! k+ A% |
   For Each vItem In Collection
& D+ G4 G0 t0 F) I# ?     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
& G; h5 q+ ~! D8 S& s       tbl = AddRow(tbl, vItem, "{object}") 9 u+ q% a2 q% `0 \5 K5 {+ C
     elseif isnull(Collection(vItem)) then
9 w( l. ^' h9 G& r9 i1 ]       tbl = AddRow(tbl, vItem, "{null}")
" ~+ E  h+ v* i1 g' e     elseif isarray(Collection(vItem)) then
& L5 }& d# g5 {2 _" I1 L" t  d       tbl = AddRow(tbl, vItem, "{array}")
6 a+ o4 P8 A% u7 L. u* R: x" x     else
  n( x: f2 _0 B       if dbg_AllVars then
& O. z9 o& V1 A' q) q& \       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
) y! Y8 R1 r4 F1 j6 j3 _8 c4 V3 l" m     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then / _; f+ H  v- t5 E
       if Collection(vItem) &lt;&gt; "" then 4 @5 B+ w$ r  P3 Y
       tbl = AddRow(tbl, vItem, server.HTML0 I9 [; c; T* M) \
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 5 K/ c5 q# F. g
       else
+ _! ^& X' u# o) Z9 ~0 N+ D       tbl = AddRow(tbl, vItem, "...")
* [- @+ E1 n7 c, P       end if . q* K4 {) m0 Y7 B
     end if
/ o: o3 P; C+ O$ `0 H+ U- W   end if 1 m/ h& [2 ^* |1 }
   Next * K7 s. T: N9 e! V) ^; p8 K- v' 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
$ m9 z$ X" e% Q9 v3 u6 j( s- e+ E   tbl = MakeTable(tbl) + [" t; d# y" K3 {
   if Collection.count &lt;= 0 then DivSetNo =2 ! B; W# c/ w$ q0 w* F0 n$ z
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) N. k# O  s/ K( \  \+ M6 e     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
6 B1 ]3 {7 K( N5 K/ P+ d6 v2 S     Response.Write replace(tbl,"|", vbcrlf)
3 f0 E$ F) J/ e+ X2 H; f' zEnd Sub # k8 L0 R+ G" P
  
+ n9 U( H& J1 \1 T) l'*********************************************************** 8 a. u, l1 G  s: [6 a; [) s/ u
'* AddRow 5 `8 X; `# S5 s: P9 |* G
'***********************************************************
4 Y1 V) Y: Q% a1 m* w' c/ y5 k8 o+ sPrivate Function AddRow(byval t, byval var, byval val) - f1 i/ \* [( U3 l% `: T5 \
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" ) S0 C1 r% T& ?4 E
   AddRow = t . B. B/ E2 [1 _/ R5 x. e# m% z( C
End Function </P><>'***********************************************************
1 h, w  m- J' Y6 ^, \5 F+ }'* MakeTable * a. f% ~& v! v+ z% J! ?* g
'***********************************************************
' y9 D: J( q! d" G' }/ Z$ H5 SPrivate Function MakeTable(byval tdata) ) @/ h, w3 ]- V
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ) O3 w% H1 C6 [/ d' c3 A/ G
   MakeTable = tdata ! r/ Y; h* [6 I3 A' s9 u: Z
End Function </P><>'***********************************************************
! N+ F% B- ^* D! N0 l, x. }''@SDESCRIPTION: Draws the Debug-panel
; m5 P6 {0 i0 B$ R0 ~: @( h, n'*********************************************************** 3 @. a* Y& T6 b' }5 O; v3 y( P
Public Sub draw()
- M, P+ {1 i& P( H' r6 u  F! N   If dbg_Enabled Then
! m: ~0 i& Z; Z% Z' i8 b* b     dbg_FinishTime = Now()
' ]# W4 f+ p5 J6 `( N3 c  8 ?0 H. o) L2 u
   Dim DivSet, x 3 I5 A0 `, R2 Y: y. O
   DivSet = split(dbg_Show_default,",")
0 Z' a) M' `( L% C. y     dbg_Show = split(dbg_Show,",") : {6 b2 T0 }. _4 M5 t& N+ Z6 z$ G  {
  
. F8 T# ]5 W9 O% I8 r1 [( S$ [1 c   For x = 0 to ubound(dbg_Show)
  j- X% t0 \& Z     divSet(x) = dbg_Show(x) ) k1 E3 T, k5 H" ^; ~) _
   Next 8 G: d; G1 j+ v* u
  ; q6 Q  c) u' K8 M; U$ H% s
   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" {! r7 X% k8 R' U( u( l   Call PrintSummaryInfo(divSet(0)) & m3 q7 g0 ?; L/ u7 w
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 0 N$ {- ^1 U. C6 `  j3 I# ?& s
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
4 _% n" K. n! X; S6 A    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 C5 U" h4 y# T7 ~0 |' m    Call PrintCookiesInfo(divSet(4)) $ f% J: }$ C9 y; P4 _# g
    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))
, X1 @/ h+ q: P" I( y    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") * ^; _# l- c/ I# J/ D4 ^  Q
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
9 H/ Z/ J$ Q7 G. W, I    Call PrintDatabaseInfo(divSet(8))
" }9 j# m" h' I  o3 @- H    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
' t+ x( }; L* Q4 _" _5 V$ a9 d    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")   `: Q- p+ X: n" `/ ~7 r5 v4 Q& l
    Response.Write "&lt;/Table&gt;"
/ `2 ]8 N& I+ u   End If
" Q/ w% q( c5 N7 T) L: mEnd Sub </P><>'Destructor
; d$ s0 P2 J4 S0 Z6 fPrivate Sub Class_Terminate()
7 l; K& V* I- j; x7 J0 Q! z   Set dbg_Data = Nothing " O2 A# S+ b- S+ Y2 S4 q! \
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 j6 N/ u2 V7 `' `9 @& Q" uCLASS debuggingConsole " c+ N% W* h; w4 [1 q6 ?
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 ?0 H5 S6 d; N6 J$ u' j&amp;n
: ]; J% ~7 f7 S2 i& ^5 ubsp; . L0 m8 N6 O7 [# ~3 R/ @3 x
Property Get Enabled===[bool] Gets the "enabled" value
, Z/ m& t! v4 P7 k' o  
& Y9 k6 T* M$ ^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 + ]! J" q1 d9 Q
  
/ v1 M7 Z( q& i3 G8 y9 H6 n8 xProperty Get Show===[string] Gets the debugging panel.
  u0 A+ S/ U: c* ~* J& h  ' u* B% K2 z: C( l2 U3 e) L1 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><>--------------------------------------------------------------------------------
0 M1 Q7 h) v% ^( X$ ZPublic Methods </P><>public sub===Print (label, output) " ~; n+ s* {; ^+ x& R, y
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
2 {3 ^1 T- f4 n( |% }+ D   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () $ s  N6 X: p. ?: c# p# C
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 7 K1 V3 Q& }1 d0 ^
Methods Detail
( q: a0 x7 A. y' E  
8 |, `' Z9 C; }public sub===Print (label, output)
# C' O$ d6 k) ]% Q+ j0 ?Parameters:  
4 X$ H$ {! }* e/ g8 V   - label [string]: Description of the variable
9 ^. ?& X+ u1 z2 m; l6 b   - output [variable]: The variable itself
8 _: K0 {1 B$ J% v5 a0 @  
: j% e, L$ D4 epublic sub===GrabDatabaseInfo (byval oSQLDB)
% u, S. ^0 e5 G7 @! ~; p- f3 g4 kParameters:  
" w9 R9 q( |3 a9 u( D   - 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-12-30 22:52 , Processed in 0.717354 second(s), 56 queries .

回顶部