creating usable records - warning: long question

John Esak john at valar.com
Sun May 30 21:54:41 PDT 2004


Lee,
You're going to hate this advice... and normally, I would jus skip over a
message like yours. But, you are asking for advice for the future and the
only _good_ advice that can be offered (at least by me) is that you should
_never_ build filePro files based on @rn... not for any reason, really.  I
don't know why you are doing it now, or what benefit it gives you... but the
very first thing you should do for "the future" is add a uniqure code field
to this file. Fill it with a unique number on each record and make sure that
unique number gets added to all detail records that might be attached to
these records.... I can only assume you are using record number to attach
detail records.  In any case, whether or not this file has other related
files. Get out of the record number business. There is no good reason to use
the record number assigning specific ones to each new addition to the file.
Sorry, not to give any advice on what it is you actually want to do, but
what you want to do is generally, no make that always, a bad idea.

I suppose I could say I'm curious and ask why you need to do things this
way, but you don't have to tell me... no need to defend the idea... it's
enough that you are doing it and feel you need to... but I submit to you
that there is _nothing_ that you can do using a record-number-based system
that can't be done far better with a unique numbered field.

John

Visit The FP Room http://www.tinyurl.com/yuag7 24/7

  -----Original Message-----
  From: filepro-list-bounces+john=valar.com at lists.celestial.com
[mailto:filepro-list-bounces+john=valar.com at lists.celestial.com]On Behalf Of
Leefp1 at aol.com
  Sent: Sunday, May 30, 2004 2:51 PM
  To: filepro-list at seaslug.org
  Subject: creating usable records - warning: long question


  While working most of this weekend to correct a problem resulting from a
VERY stupid action on my part (a long boring story), I again ran across a
needed programming (or maybe system administration) strategy that I wonder
how others handle.  I will give a simplified illustration.

  If you wanted to post information to records in a file but you wanted to
be able to select the record number to which you were posting (i.e. Not just
to any free record), how would you do it.

  I have occasionally had this need.  When starting with an empty file it is
no problem.  I would just add as many records needed and place an innocent
character, like a period, in a field in each record; do my posting; then
delete all the records that still only had a period as the only character in
the record.  As a result, all my records are where they need to be and now
empty records are available as free records for the future.

  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.

  So, my question from all this rambling...  What would be the best strategy
to create usable records within a file to which one can post by specific
record number?

  Thanks for any advice for the future.

  -Lee

  BTW... finally this weekend, I copied the file to another name, deleted
key and data files in the original file, created "period" records of
sufficient quantity in the original file and then posted back from the new
file and posted my needed info all to specific record numbers.

  Also... I know that the reason I need to do such a thing is a mistake made
many years ago to use record numbers as ID numbers under certain
circumstances.  I know it is not good programming, but it has not burned me
very many times and to change now would not be worth it.
  ----------------------------------------
  Lee B. Walker
  Walker & Company
  5307 Front Royal Drive
  Cross Lanes, WV 25313
  304.419.0013
  lee at walkeronline.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.celestial.com/pipermail/filepro-list/attachments/20040531/42d52473/attachment-0001.html


More information about the Filepro-list mailing list