|
-
January 27th, 2010, 09:29 AM
#5
Re: open, read, write file binary ?
I forgot: To write records you need the same declaration of the record type.
Code:
Dim Rec As MyRecordType
Open FileName For Random As #1 Len = Len(CurRecord)
Rec.Name = "wahwah"
Rec.Address = "Somewhere"
Rec.PhoneNumber = "1234"
Put #1, , Rec
Close #1
This would write a new record to the file. After Open, it would start writing at the first record.
Put allows you always to specify the recordnumber, so as you can overwrite any record even in the middle of a file.
And there is the Seek statement to put your current record pointer to a specific record.
Last edited by WoF; January 27th, 2010 at 09:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|