07-10-2009, 07:56 AM
You need a record placeholder in the PUT otherwise it will write over beginning records. PUT assumes it's own consecutive record places if you dont. That is why you lost data.
PUT #fh, 6, names 'writes to the 6th record. ALWAYS use a record number!
You can use a FOR loop or counter variable.
So how do you find out how many records are already in the file?
To add records use PUT placeholders above the number of old records.
Ted
PUT #fh, 6, names 'writes to the 6th record. ALWAYS use a record number!
You can use a FOR loop or counter variable.
So how do you find out how many records are already in the file?
Code:
recordlen% = LEN(names) 'recordlen is always an Integer!
NumRecords% = LOF(fh) \ recordlen 'you may want to print the value.
To add records use PUT placeholders above the number of old records.
Ted
Get my QB demonstrator here: http://dl.dropbox.com/u/8440706/Q-Basics.zip