1 |
Attribute VB_Name = "addressbook" |
2 |
Public Type AddressBook |
3 |
name As String |
4 |
atype As Long |
5 |
filename As String |
6 |
End Type |
7 |
|
8 |
Public whfc_book(65000, 7) As String |
9 |
Public whfc_book_count |
10 |
Public adrbooks(100) As AddressBook |
11 |
Public adrbooks_count As Long |
12 |
|
13 |
Sub read_whfc_book(ByVal name As String) |
14 |
Dim data |
15 |
Dim lastpos |
16 |
Open name For Input As #1 |
17 |
Input #1, data |
18 |
Close #1 |
19 |
lastpos = 8 |
20 |
whfc_book_count = 0 |
21 |
While InStr(lastpos + 1, data, "|") > 1 |
22 |
For n = 0 To 7 |
23 |
whfc_book(whfc_book_count, n) = Mid(data, lastpos + 1, InStr(lastpos + 1, data, "|") - lastpos - 1) |
24 |
lastpos = InStr(lastpos + 1, data, "|") |
25 |
Next n |
26 |
whfc_book_count = whfc_book_count + 1 |
27 |
Wend |
28 |
End Sub |
29 |
|
30 |
Sub write_whfc_book(name As String) |
31 |
Dim m, n As Long |
32 |
Open name For Output As #1 |
33 |
Print #1, "PBOOK1.1"; |
34 |
For m = 0 To whfc_book_count - 1 |
35 |
For n = 0 To 7 |
36 |
Print #1, whfc_book(m, n); "|"; |
37 |
Next n |
38 |
Next m |
39 |
Close #1 |
40 |
End Sub |
41 |
|
42 |
Sub create_whfc_book(name As String) |
43 |
Dim m, n As Long |
44 |
Open name For Output As #1 |
45 |
Print #1, "PBOOK1.1"; |
46 |
Close #1 |
47 |
End Sub |
48 |
|