source: Include/Classes/System/Diagnostics/Trace.ab@ 44

Last change on this file since 44 was 44, checked in by dai, 17 years ago

Indent/Unindentに対応してみた。Assertの骨組みを書いたので、後ほど細かい実装をしたい(コールスタック、どうしよう…)。

File size: 955 bytes
RevLine 
[43]1Class Trace
[44]2 Static IndentNum = 0 As Long
3
4 Static Function GetIndentString() As String
5 Dim i As Long
6 Dim ResultStr = ""
7 For i = 0 To ELM( IndentNum )
8 ResultStr = ResultStr + Ex"\t"
9 Next
10 Return ResultStr
11 End Function
[43]12Public
[44]13
14/*
15 TODO: 実装
16
17 ' アサート表示
18 Static Sub Assert( condition As Boolean )
19 If condition == False then
20 'TODO: コールスタックを表示
21 End If
22 End Sub
23 Static Sub Assert( condition As Boolean, message As String )
24 If condition == False then
25 WriteLine( message )
26 End If
27 End Sub
28*/
29
30 ' インデントレベルを上げる
31 Static Sub Indent()
32 IndentNum++
33 End Sub
34
35 ' インデントレベルを下げる
36 Static Sub Unindent()
37 If IndentNum <= 0 Then
38 IndentNum = 0
39 Return
40 End If
41 IndentNum--
42 End Sub
43
44 ' 一行の文字列を出力
[43]45 Static Sub WriteLine( message As String )
[44]46 Dim tempmsg = GetIndentString() + message + Ex"\n"
[43]47 OutputDebugString( tempmsg )
48 End Sub
49End Class
Note: See TracBrowser for help on using the repository browser.