A Problem Using Filepro
Richard Kreiss
rkreiss at gccconsulting.net
Tue Apr 16 14:28:21 PDT 2013
> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com] On
> Behalf Of Harold Faulkner
> Sent: Tuesday, April 16, 2013 12:30 PM
> To: 'FilePro Mailing List'
> Subject: A Problem Using Filepro
>
> Hi,
>
> I have been aware of this problem for some time, but it appears worse now.
> The problem is the Record Number when entering a new record.
>
> My Navy Reunion Group uses Filepro to list all men who served aboard our
> Destroyer, The U.S.S McCaffery DDE860 and I keep the master copy of Filepro,
> and the master list of crewmembers and officers.
>
> The problem is blank records in the list. For some reason when we go to add
> a new member to the list, Filepro skips a record, and places the data on the
> next record.
>
> I just checked and we have 1896 records in the McCaffery file, but when I go
> to add a person, he will go on record 1898, instead of record 1897.
>
> How can I keep this from happening? As I said earlier, this problem seems to
> be worse.
>
> Harold
A very long time ago a very wise filePro programmer named Ken Brody suggested that using record numbers for a key value was not a good Idea. You are seeing one of the problems with doing this. The other problem is "what happens if you delete a record and then add a new record"?
I have a friend who was using record numbers as product identifiers until he realized that if he deleted an item and then add a new item, the new item could have the product number of the old item. This would mess up his inventory and purchase orders. I suggested to him that he add a field to the file and copy the record number into that field. Then build an index on the field and add programming to add the next available product number based on that index. The record number no longer mattered. Of course he had to adjusted other programs to use an index lookup rather the a record number lookup.
So, if a possible skipped record number bothers you, try my suggestion as it will insure that you always get the next number by adding 1 to the highest value in the index using lv="99999999" lookup foobar k=lv i=A -nl This assumes that the new field is indexed using index A of course.
Richard Kreiss
GCC Consulting
Office: 410-653-2813
More information about the Filepro-list
mailing list