This repository has been archived by the owner on May 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MMain.bas
99 lines (86 loc) · 2.13 KB
/
MMain.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Attribute VB_Name = "MMain"
Option Explicit
Sub Main()
End Sub
Public Sub TestCRow()
Dim oRow As CRow
On Error GoTo TestCRow_Err
Set oRow = New CRow
'Define: name, type, size, flags
oRow.Define "String", vbString, 0&, 0&, _
"Boolean", vbBoolean, 0&, 0&
oRow.AddCol "Date ", Date, 0&, 0&
RowDump oRow
Set oRow = Nothing
Exit Sub
TestCRow_Err:
Debug.Print "TestCRow, Error #" & Err.Number & ": " & Err.Description
Set oRow = Nothing
End Sub
Public Sub RowDump(poRow As CRow)
Dim iRow As Long
Dim i As Long
Dim lCount As Long
Dim asColName() As String
Dim iLen As Integer
lCount = poRow.ColCount
'col titles row sep
For i = 1 To lCount
iLen = Len(poRow.ColName(i))
Debug.Print String$(iLen, "-"); "+";
Next i
Debug.Print
For i = 1 To lCount
Debug.Print poRow.ColName(i); "|";
Next i
Debug.Print
'col titles row sep
For i = 1 To lCount
iLen = Len(poRow.ColName(i))
Debug.Print String$(iLen, "-"); "+";
Next i
Debug.Print
'dump values
For i = 1 To poRow.ColCount
iLen = Len(poRow.ColName(i))
Debug.Print StrBlock(poRow.ColValue(i) & "", " ", iLen); "|";
Next i
Debug.Print
End Sub
Public Sub ListDump(oList As CList, Optional ByVal sTitle As String = "")
Dim iRow As Long
Dim i As Long
Dim lCount As Long
Dim asColName() As String
Dim iLen As Integer
lCount = oList.ColCount
If Len(sTitle) Then
Debug.Print String$(Len(sTitle), "-"); "+"
Debug.Print sTitle; "|"
End If
'col titles row sep
For i = 1 To lCount
iLen = Len(oList.ColName(i))
Debug.Print String$(iLen, "-"); "+";
Next i
Debug.Print
For i = 1 To lCount
Debug.Print oList.ColName(i); "|";
Next i
Debug.Print
'col titles row sep
For i = 1 To lCount
iLen = Len(oList.ColName(i))
Debug.Print String$(iLen, "-"); "+";
Next i
Debug.Print
'dump values
lCount = oList.Count
For iRow = 1 To lCount
For i = 1 To oList.ColCount
iLen = Len(oList.ColName(i))
Debug.Print StrBlock(oList.Item(i, iRow) & "", " ", iLen); "|";
Next i
Debug.Print
Next iRow
End Sub