fb:porticula NoPaste
Datensätze mit TYPE und BINARY
Uploader: | Sebastian |
Datum/Zeit: | 09.03.2013 14:20:41 |
TYPE tDatensatz
Vorname As String * 6
Alter As String * 2
END TYPE
Dim Kartei(1 To 3) As tDatensatz
Kartei(1).Vorname = "Gundula": Kartei(1).Alter = "50"
Kartei(2).Vorname = "Theoleptikus": Kartei(2).Alter = "35"
Kartei(3).Vorname = "Gunilla": Kartei(3).Alter = "25"
Open ExePath + "/verw2" For Binary As #1
For i As Integer = LBound(Kartei) To UBound(Kartei)
Put #1, , Kartei(i)
Next i
Close #1
' Jetzt wieder einlesen
Dim Neu(1 To 3) As tDatensatz
Open ExePath + "/verw2" For Binary As #1
For i As Integer = LBound(Neu) To UBound(Neu)
Get #1, , Neu(i)
'Konsolenausgabe:
Print Neu(i).Vorname; " "; Neu(i).Alter
Next i
Close #1
Sleep
End