Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
freefile to make appendable a random file?
#3
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?

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
Reply


Messages In This Thread
Re: freefile to make appendable a random file? - by Clippy - 07-10-2009, 07:56 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)