Private Type Tele
Name As String * 15
Tel As String * 15
Pos As Long
End Type
Dim Pers As Tele
Dim RecNum As Integer
Private Sub Command1_Click()
Open "t5.txt" For Random As #1 Len = Len(Pers)
RecNum = LOF(1) / Len(Pers)
Do
Pers.Name = InputBox("请输入姓名")
Pers.Tel = InputBox("请输入电话")
Pers.Pos = InputBox("请输入邮政编码")
' RecNum = ?
' Put #1, ?
asp = InputBox("More(Y/N)?")
' Loop While UCase(asp) ?
Close 1
End Sub
Private Sub Command2_Click()
Open "t5.txt" For Random As #1 Len = Len(Pers)
' RecNum = ?
Cls
For i = 1 To RecNum
' Get #1, ?
Print Pers.Name; Pers.Tel; Pers.Pos
Next i
Close 1
End Sub