QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
0 h4 F$ Q# a9 Z7 M: z<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 5 s7 m" ~* V. v$ k; I% E8 \
使用方法很简单:
6 ?4 M9 G' I' e/ f5 ctest.asp </P>' ]- P* C9 ^$ A
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; $ X' `3 C3 m* X1 }  w6 B
&lt;%
5 v+ C" p9 i! t/ g+ g. koutput="XXXX"
! ~  T! _8 t9 O# f# I; L8 k4 BSet debugstr = New debuggingConsole ; ?7 W. g% w$ j6 `7 j* j
debugstr.Enabled = true ) R, J/ [' k7 ^7 y9 R
   debugstr.Print "参数output的值", output . C5 [5 Q. N4 f. c) O. V3 h
   '……
# {+ }- n7 U6 ^, b! X) X& G   debugstr.draw
: k+ h* u& P) p; {5 g& p) SSet debugstr = Nothing 0 H/ Z( T  o, @
%&gt; </P>. v) C  s$ _& U1 v0 s7 K# f, T! g
<>=================================================== </P>
4 e% Q$ \4 B# G4 h/ Q" P: o<>debuggingConsole.asp </P>$ x2 ^0 c2 N% l- ?' x
<>&lt;% . B" H; M: r/ f( w4 m+ Z* u
Class debuggingConsole </P>
1 ~5 k0 l, F% H. \  v& B- W<>   private dbg_Enabled
4 m' p: O* @8 B) A2 u1 \   private dbg_Show * S, ?% W8 K# Y& L- }
   private dbg_RequestTime
5 @) X8 i# U8 B( i, P   private dbg_FinishTime
( I: O8 I8 b8 x* I% s   private dbg_Data * K- @+ D( E( g  Q/ H% `( t
   private dbg_DB_Data
, a0 L  _: B# u7 P   private dbg_AllVars
4 Y5 ?) i  l5 X   private dbg_Show_default
% \1 \3 r- x6 [3 \( g7 X   private DivSets(2)
; U$ q& S6 e' g/ {, Z+ O   # {& L  x# v9 {: W) D* f- v7 I* d1 j
'Construktor =&gt; set the default values / w' {2 w! L0 ?
Private Sub Class_Initialize() 5 P& a$ C9 {1 y  ~
   dbg_RequestTime = Now()
  ~3 [" H$ i$ V% P   dbg_AllVars = false & {$ J' `! u' }) D, {! `% ?  Y
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>" ?0 I& p4 ]1 ?: |( X0 d
<>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>( t8 N5 N: f3 }: I! ^/ K
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;3 G: t3 a4 \# D  x- _9 R4 S
&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 E8 g2 Z4 C4 j9 L$ S, f<>   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 d4 M( N1 \4 t1 x7 }<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
6 k5 C; w& j4 \3 j3 a% XEnd Sub </P>
2 e  a) }1 C# `9 C& f* `0 O: ]* m, O% X<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
: J: R" n6 B8 _! d5 U1 V% @   dbg_Enabled = bNewValue ; _+ J$ Y  c3 k5 P( ^
End Property </P>) y) o+ G" D8 f
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
/ h( x- ?' Q) q( W* r9 A   Enabled = dbg_Enabled
* [; D* x. _' @End Property </P>6 W0 t7 A7 `- v0 R4 B5 G
<>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
# @$ o" ?' I, I. V* O5 \6 ^   dbg_Show = bNewValue
2 l& @! {/ B; o6 T8 ^% [- _( oEnd Property </P>5 Q  e! r' k4 ~: B
<>ublic Property Get Show ''[string] Gets the debugging panel. 4 ]! x( L( P4 z" }* X, b
   Show = dbg_Show . t6 R0 r  Z) V) I  V  H5 ]1 x# z
End Property </P>
, V6 J# F% V  {$ b<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
! y- G0 W0 Y' Z; c* y' U  |' v   dbg_AllVars = bNewValue
7 l4 q/ m/ y' T8 t' xEnd Property </P>. M6 E. g: m! A2 E( n
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 3 L: R. `$ R; ^0 T4 e( p5 r
   AllVars = dbg_AllVars
: ^9 j! C8 n! m- R9 L1 FEnd Property </P>) }- d, Q+ E. r. p7 c. a" ~4 g
<>'*********************************************************** 3 K9 J' P3 x9 `
''@SDESCRIPTION: Adds a variable to the debug-informations. " r" M- M4 @' X6 Y' t
''@PARAM:  - label [string]: Description of the variable 3 b% O: ?  r( n; Q! w
''@PARAM:  - output [variable]: The variable itself
1 K: K# _  h/ Q0 U'*********************************************************** 8 ~5 s1 r0 u& C1 K- N1 ?7 U! J
Public Sub Print(label, output)
# I# U7 Q- i. U1 A" }2 a. l% x   If dbg_Enabled Then
# h, {5 R6 t: W8 h     if err.number &gt; 0 then
1 R) t, [% {( T       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
) }0 S! f' h: U. \* a. W- q- Z       err.Clear 1 o; }( a3 v1 @+ P7 K
     else ) Q3 V7 L1 w0 v. O. C0 F- h
       uniqueID = ValidLabel(label) $ Q% j3 k8 ?" r4 A# L. |6 m5 P
       response.write uniqueID & X0 H; g& M' u  q( n- i
       call dbg_Data.Add(uniqueID, output)
, O; p% u+ q  O; p6 b8 M* Y$ Z3 C     end if ) C6 C3 e! z$ ~, `4 E2 g
   End If
9 v4 \( M3 y6 Y7 O" i9 K4 qEnd Sub
: }4 o$ n: w* u7 b  7 W4 }* ^" K  `8 V
'***********************************************************
- `7 x# c5 @. v1 t'* ValidLabel   i+ W+ ^2 N, U. O" O4 j
'***********************************************************
6 Z# \  W7 D. @( \9 F$ h3 l  z( MPrivate Function ValidLabel(byval label) 6 U3 I" V# f: o5 e$ ~
   dim i, lbl
& T+ {& ^6 [/ d7 j   i = 0 - ]' @0 c3 x" T! ?% A" \; f* k
   lbl = label 4 F6 k$ M/ K$ R" o$ `( k
   do
: {% c7 O/ [  q' B/ Z. D4 P! p   if not dbg_Data.Exists(lbl) then exit do
: G  _5 K# e7 E   i = i + 1
6 }5 `- t: j8 X   lbl = label &amp; "(" &amp; i &amp; ")"
0 p' z8 J: H. E8 r3 r" n   loop until i = i
3 e% t5 j  e# t. A/ o' o2 h# E0 }  
1 }* i% [  i: u' A$ p3 K* S   ValidLabel = lbl
6 ^1 u0 R+ ^# H9 A; X4 DEnd Function
0 f1 ^* s  t+ Q% `! O2 k5 H+ V0 `  
$ b" e  u- p$ z7 `6 i'***********************************************************
3 j" x' ?' U. A( ]1 b2 C( y'* PrintCookiesInfo , A3 B9 ~8 Z. I" `+ E
'***********************************************************
* Q0 y' F1 E$ K( APrivate Sub PrintCookiesInfo(byval DivSetNo) ) i: T4 k& B1 h. i
   dim tbl, cookie, key, tmp & B& w* N" o! f
   For Each cookie in Request.Cookies
& D7 L" L6 G; B6 e* t$ n   If Not Request.Cookies(cookie).HasKeys Then
  ?' L. {" u, {, N) @1 D1 c     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
8 u5 G2 t& e$ n) k* }  K   Else
0 b" k% Y) v/ F8 d6 y/ s+ I     For Each key in Request.Cookies(cookie)
3 q7 t0 Y: C) |6 u8 w     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
5 Y6 |. N! A+ E" lCookies(cookie)(key))   5 w3 P- X( V* p/ {9 [1 e
   Next . W5 m" K5 r% X# c- u5 K
   End If : u" b- B8 B) D& T# C
   Next </P>1 j5 f! Z) h& n" o1 u+ q
<>   tbl = MakeTable(tbl) & S! H' N% ]+ N  ^0 t
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ' ?/ q# f$ x% G' J
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ' e7 V$ t* A" c0 S2 V% N; ^
   Response.Write replace(tmp,"|", vbcrlf)
/ \+ Y' B1 M: u5 P1 y- j- p3 Hend sub 2 F# `7 L7 T8 J' r! S/ |
  
" P+ S7 B) t# h'*********************************************************** ! h8 s! \' [; ~& H8 V
'* PrintSummaryInfo ) W! R4 r4 r3 @
'*********************************************************** " q" D5 o, I" ~- C# a
Private Sub PrintSummaryInfo(byval DivSetNo)
, N; v: f& z8 q1 K* E( _, ]0 D   dim tmp, tbl
1 N$ T9 g5 \+ {- V/ m   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
4 m1 \0 i  w8 G7 d3 W   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
6 l9 X4 k) G: y% I6 f0 l   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 m6 w6 d/ `  r& }   tbl = AddRow(tbl, "Status Code",Response.Status) ( c, L7 T* j9 t% ^. U
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
' }, \' M4 z3 `   tbl = MakeTable(tbl) ' _. D* ?. u8 w/ ~! L2 C
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
, [5 V* S/ G" O: r$ Z1 T% p   Response.Write replace(tmp,"|", vbcrlf) # F# T  Y! b( m
End Sub </P>" |% K  |& B/ b0 Z" k
<>'***********************************************************
) c4 _/ n0 j( Q- O" t$ m''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information " z/ [" ~  a3 P+ `2 B3 r. c
''@PARAM:  - oSQLDB [object]: connection-object * F0 ^/ {0 ?$ n
'*********************************************************** # C2 g& P+ J9 z( ^, m; `1 T; j
Public Sub GrabDatabaseInfo(byval oSQLDB) / ]' m7 A+ A- |0 J  s; \, f0 O) H7 m: l# M
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
& n8 S7 K. P: {: h! e9 O   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
8 R8 g% |% U& K% k+ W   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, V: Y( W  S, y, M
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) & Z% R, h/ ]$ v  J4 p  [
End Sub <>'***********************************************************
8 H+ |* N6 d% C) @( n6 |'* PrintDatabaseInfo
0 ~/ Z% d8 i  S' ^'***********************************************************
3 H* S' ~! R& {, d& [Private Sub PrintDatabaseInfo(byval DivSetNo) 0 g7 _5 f0 u  ]% C' l
   dim tbl
4 \% R9 S' \! x+ C   tbl = MakeTable(dbg_DB_Data)
+ F- z) c# p/ k4 N* q   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 l0 z: G5 Y: i  w* @
   Response.Write replace(tbl,"|", vbcrlf)
- [# Y) n5 c1 ]$ S+ g, _End Sub </P><>'*********************************************************** ) g6 Y8 H% h; R5 x0 s0 o( L  C
'* PrintCollection & }4 ?6 T' Z$ D9 X6 F
'***********************************************************
3 r& o0 H0 Q: H) @" b' n! y# YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
* `$ T7 T$ W. P$ G8 [/ z   Dim vItem, tbl, Temp * g( V1 F% o8 R+ z  v
   For Each vItem In Collection
6 k4 E9 M) B: L) [8 `     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
5 w. _9 B0 s" j+ V. p3 \       tbl = AddRow(tbl, vItem, "{object}")
3 X' f) P2 Z% @% t5 h6 D     elseif isnull(Collection(vItem)) then
# y$ g! g. C( \. b# D9 l5 D' |, A" f       tbl = AddRow(tbl, vItem, "{null}") . x; A0 M) [$ C: r! T
     elseif isarray(Collection(vItem)) then
! K6 h, c, G& t3 L# r0 o8 A$ P1 U       tbl = AddRow(tbl, vItem, "{array}")
- x* n0 z! Q6 M4 R0 m4 R7 K     else 9 g; P8 }* ?# I# G
       if dbg_AllVars then 5 O2 u- N4 |/ C* c! g
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) * Y3 W! A" Q$ B9 v: S" i
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
, D; ]' s8 _# Y8 u0 O, Z0 E       if Collection(vItem) &lt;&gt; "" then 1 ~3 c/ P) n5 b/ n
       tbl = AddRow(tbl, vItem, server.HTML
( N2 m/ b# B1 S0 s1 }* tEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
" @( D, C' N0 o5 C+ A/ U       else
" V- m% v5 a9 C" F9 Q- m       tbl = AddRow(tbl, vItem, "...")
& w6 D; y/ y, \. |) t       end if / I: b/ @& h( ]  ^! O- t3 J
     end if - Y/ o2 y) S8 _! w1 _5 k
   end if
7 D" @$ X" @  [0 D: Y0 F   Next
4 E) z' P4 c4 I$ R9 V1 o" J   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo & U, e) f- d' O: ~1 E  d
   tbl = MakeTable(tbl) 8 Z) q3 y$ o7 Y/ v9 ]
   if Collection.count &lt;= 0 then DivSetNo =2
: K/ J5 @% k+ u* V6 I* ^9 ^( s& F     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 9 x6 k2 c1 g( t8 {- u( H
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 9 r' h5 Y' b2 x$ q
     Response.Write replace(tbl,"|", vbcrlf) $ y  Z/ }# T6 l9 g: j
End Sub 4 @( x0 a" j! K9 _
  
3 o: M$ E  N9 j( y'*********************************************************** ) o  [; T' \. w) J
'* AddRow
1 K6 p2 m& L7 ~. T5 y'***********************************************************
: d; [0 _9 O" dPrivate Function AddRow(byval t, byval var, byval val) / I- [% ~- d# u1 _
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
2 Y% ~. B+ s/ i, d   AddRow = t # e+ `7 b+ s& F, ]3 d
End Function </P><>'*********************************************************** 1 h+ s. F" b8 [* v7 ~
'* MakeTable
, v+ G4 }6 {. P2 X, C( D; v'*********************************************************** 0 ]) Z8 P! p' _: }
Private Function MakeTable(byval tdata)
* R+ b5 B+ r& q+ N; H   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
' l# _- ?  g, @# ~7 E6 T   MakeTable = tdata
  H7 \. a! c: x! q- @End Function </P><>'*********************************************************** # d8 u: E7 I  x3 Y& n
''@SDESCRIPTION: Draws the Debug-panel
3 ^' w$ o3 f4 @9 k  _" i% P. m' V'*********************************************************** & N; D& V& d: [+ ^' z" r
Public Sub draw() - W' S# b) c$ F- e, i2 B  @: @
   If dbg_Enabled Then % l! }& E4 x1 \$ {+ X. @
     dbg_FinishTime = Now()
$ N% C6 u( z  M4 _; |/ l  
4 q7 n# D# d, [3 }% _& g   Dim DivSet, x
5 Q1 i7 L5 W6 ]4 e) N3 h   DivSet = split(dbg_Show_default,",")
1 `; s% b& x) V' q     dbg_Show = split(dbg_Show,",")
# g' P& k! o$ l6 x' @8 O  
& l) V3 }4 v6 S- Z" Y   For x = 0 to ubound(dbg_Show) ! c0 Q% M; Q! O
     divSet(x) = dbg_Show(x)
5 u# X4 Z  g5 P( W# i, a   Next
/ Z2 `* {. s3 S+ }( B; }  
0 m& z+ b9 C/ ?   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;"
4 I- c6 D) g4 ^/ X& S   Call PrintSummaryInfo(divSet(0))
# \. s; [$ {! W     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
  Z5 C7 i2 g( o0 l" |    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 e2 F7 K8 t& y1 t; C9 z9 r
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
0 T: `1 T- s' `3 a% {; v3 H/ E    Call PrintCookiesInfo(divSet(4))
/ M& n* B- M8 Z3 _    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. \) `. K2 q9 p
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
1 b1 `' m9 c2 u  D    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) $ `' Y1 y( f" I9 G6 I  o
    Call PrintDatabaseInfo(divSet(8))
$ c, r6 D: \2 _" G8 V    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ; F% {5 v) E! F$ Z
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, k5 N: n; z( E# f* Z3 o4 t    Response.Write "&lt;/Table&gt;"
& X6 h5 U1 @( X   End If " u7 f1 |, [' r! J6 O9 ~
End Sub </P><>'Destructor
# }5 }- K! Q; q7 XPrivate Sub Class_Terminate() 7 C  K2 y5 d& v3 h
   Set dbg_Data = Nothing - |, ?- @" h% ?2 A
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
* s8 n8 @+ [' J! I: `4 m* UCLASS debuggingConsole ; A8 C# H0 U  ]
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
( p* w4 D9 S3 J&amp;n2 W/ b3 u8 f8 y) Z: {' O$ W4 b
bsp; , s( R. X. T) B9 r& O$ A
Property Get Enabled===[bool] Gets the "enabled" value
# X' d% f6 y# Y& ]5 O( e  0 @7 Y! X2 ~* L
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 X1 H% ~6 S' F7 ^+ f  
% ^- U8 {7 Q" BProperty Get Show===[string] Gets the debugging panel. / M* Z8 P, G% z+ H/ k: s% |" Z
  ; x7 ~- ^0 v" i; |3 W! r. W, E
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><>--------------------------------------------------------------------------------
+ ~7 x) A1 C6 {0 b3 q5 |Public Methods </P><>public sub===Print (label, output)
' r/ l) T8 h: _& S/ v. m0 ^% E/ F   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
+ u! t2 H1 Z1 R0 y2 \. m   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
& H: b3 _: Y! d6 i( u4 m, [* k   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ( p0 _. d' c4 Q2 s- F
Methods Detail 9 B9 D% O# e7 ^, z  m% ]9 {" U
  2 l* p/ u" o+ u; ~; d
public sub===Print (label, output)
! I( s; L( l9 Z2 I/ JParameters:  - v( S7 B; N! f, H: m9 C, \4 W2 G
   - label [string]: Description of the variable / _# L) u2 E1 |. ~1 l; Z
   - output [variable]: The variable itself
/ k7 }2 J3 V8 r0 Z  . @8 v# }& d. s1 g. [
public sub===GrabDatabaseInfo (byval oSQLDB) - |$ s% f/ v" C( z/ _5 P
Parameters:  8 e" n$ t+ |: M! Z" S* T1 |6 q5 o
   - 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-9-20 12:17 , Processed in 0.617961 second(s), 56 queries .

回顶部