creating usable records - warning: long question
Kenneth Brody
kenbrody at bestweb.net
Mon May 31 08:27:55 PDT 2004
Leefp1 at aol.com wrote:
[...]
> But this weekend I had a complication. I was not starting with an empty
> file. I had a file in which the highest record number was about 48000 but it
> had many empty (free) records throughout (resulting from deletions). I
> needed to be able to post to record numbers up to 51000 as well as to some of
> the free records in the file. I THOUGHT I could find out how many free
> records were in the file, and add that number to the difference between 48000
> and 51000. Say the number was 5000. I thought I could then write a loop
> that for 5000 iterations would find a free record in the file and place a
> period in a field in each record. My assumption was that all of the free
> records below 48000 would be used as well as the necessary number above
> 48000. But, to my surprise, SOME of the free records below 48000 were used
> but most were not. I'm not sure why not. My thought was maybe some of the
> records were not really "free," but even if I went to a given record number
> and deleted the record, my above technique did not produce a period
> character in the record.
[...]
First, filePro will _always_ use records from the freechain before adding
records off the end. If there were still blank records below the newly-
expanded records, then either they aren't deleted, or the freechain has
been corrupted somehow.
Next, how to make sure all records up to record number X are used:
1) Rebuild the freechain. This does two things. First, it makes sure
that the freechain is not corrupt. And second, which is important
for this particular method, is that the freechain will be in record
number order afterwards.
2) Add records until @RN is greater than X.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
More information about the Filepro-list
mailing list