Does DELETE close a lookup?

Jay R. Ashworth jra at baylink.com
Mon Dec 3 08:22:21 PST 2007


On Mon, Dec 03, 2007 at 09:52:03AM -0500, Kenneth Brody wrote:
> >Well, I guess that proves that DELETE doesn't imply CLOSE.
> >
> >I believe that to be a bug.  It's especially a bug if I can't CLOSE
> >*after* I delete: I'm going to have code working against that alias
> >tag, and I don't want it to blow up if I've had to delete the record
> >(which I won't always do...)
> 
> Well, two things...
> 
> First, I believe that you are using the term CLOSE improperly here.  The
> only thing (besides exiting) that will CLOSE a lookup is CLOSE.  However,
> "if not lookupname" does not mean the file is "closed".  It means "did
> the lookup fail?"  Also, a failed lookup does _not_ close the file.

I'm clear on that.

But there's a difference between "did the lookup fail" and "does the
alias point to a valid record right now".

The first can imply the second, but not the other way around.

> Remember -- the lookup did succeed.  The fact that you deleted the record
> that you found does not change that fact.

Um, ick.

> Finally, I'm not sure what you mean by "[you] can't CLOSE after [you]
> delete [the lookup]".  First, you can certainly CLOSE the lookup if you
> want to, regardless of the success/fail state.  Second, unless you are
> finished with the file, why do you want/need to close it?

Ok, to recap: I'm going off to a subroutine wherein I lookup a record
in another file.

Sometimes, I delete the free record I've looked up, because I'm not
going to use it.

I was trying to communicate this back to the mainline code without
having to use an extraneous flag.

Clearly, the semantics of the truth value of a lookup alias are
constrained too tightly to make it possible for me to use it: they are
"did the last lookup on this alias succeed, regardless of whether the
alias validly points to a record right this minute", unless I've
misunderstood you.

Cheers,
-- jra
-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274

	     Witty slogan redacted until AMPTP stop screwing WGA


More information about the Filepro-list mailing list