Does DELETE close a lookup?

fp at casabellagallery.com fp at casabellagallery.com
Sun Dec 2 17:25:15 PST 2007


Jay posted:

> > > 
> > > 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...)
> > 
> > I added a 'close' command and delete several records without an error.
> 
> What's "an error"?
> 

You know, an error  ...  :)

[ snip ]
> 
> > Again, the close command closes the alias not a record.  'delete' deletes 
> > a record, not the alias (which would be the file itself).
> 
> OK.
> 
> lookup alias=filename k=whatever -nx
> 
> alias is supposed to be true, if the lookup succeeded, and false, if the
> lookup failed.
> 
> If I close the looked up file, or delete the looked up record, *I*
> would expect the truth value of that alias to become false -- since it no
> longer represents a successful lookup.   If it doesn't work that way, I
> see no way one could avoid executing lines which use fields from the
> target file.
> 
> You've (tentatively) proven that this is not the case for DELETE -- it
> still returns true, even though that tag now fails to point to a valid
> lookup record.

> 
> If you're telling me that the alias remains true once a valid lookup
> has been done *even if that file is then CLOSED* (close ALIAS), I shall
> be still less pleased.  :-)
> 

No, that is not what I said, at no time did I say that an alias is open
even after it is 'closed'.  I did say that:

 - delete   deletes a record not the alias
 - close    closes the alias

Our original test was based on a browse lookup ... and in my case, with
more than one record to its name.  That said, I do agree that it is a bit
fishy for it to behave this way.

In the other hand, when you remove a record you should account for that
and make sure you DO NOT allow your process to simply fall through; use
one of those handy 'GOTOs'.

I am guessing you have found this the hard way and had allowed a process
to fall through and encountered problems ... :)

Lets way and see what Ken has to say about your findings!

Regards,

---
Jose Lerebours
954  559  7186
http://www.fpgroups.com









More information about the Filepro-list mailing list