Interesting lookup processing

Mike Schwartz mschw at athenet.net
Wed May 6 20:30:28 PDT 2009



> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
> Sent: Wednesday, May 06, 2009 10:07 PM
> To: mschw at athenet.net
> Cc: 'filePro Mailing List'
> Subject: Re: Interesting lookup processing
> 
> Mike Schwartz wrote:
> >      I was looking at some programs written by another programmer
> over 10
> > years ago, and ran into this code that I didn't think would work
> reliably,
> > but it has for over 10 years now:
> >
> > -----
> > :
> > lookup INVEN K=2 (blah, blah)
> > -----
> > Not INVEN
> > Lookup INVEN = ARCINVEN k=2 (blah, blah)
> > -----
> > :
> > 3=INVEN(4)
> > -----
> >
> >
> >      I would have bet, internally, that filePro would get confused by
> the
> > "dual" use of the word INVEN, especially if one part was found in the
> active
> > inventory file and the next part was found in the archive inventory
> file.
> >
> >      Is this something that potentially could be causing problems, or
> is
> > this perfectly legitimate code?
> 
> It's perfectly legal, and is, in fact, one of the reasons for having
> aliases
> on the lookups.  No "confusion" occurs, since this is part of the
> design.
> 
> A very common use is to perform one lookup, and if it fails, perform
> another
> one, perhaps to a different file, or a different key.  This is
> precisely
> what your example does.  It does a lookup into the inventory file, and
> if it
> fails, it then tries the archive file.
> 
> --
> Kenneth Brody

     OK.  I've always used a different word (not the names of either of the
files) because I assumed that the real names of the files became like
reserved words, as far as aliases go.  IE,

-----
Lookup IVT = INVEN
-----
Not IVT
Lookup IVT = ARCINVEN
-----

     As long as I know that this won't cause any problems, I'll leave the
code as-is.

     Maybe one of the reasons I started doing this was to keep the names as
short as possible.  It's hard to remember back over 25 years ago, to the
days when Marve Wyman and I were feeling our way through the 0.75 and 0.80
beta versions of Profile 16!!!  And, of course, Marve's not around anymore
to jog my memory...  (May he R.I.P)

Thanks!

Mike Schwartz











More information about the Filepro-list mailing list