Lookup "gotcha"

Richard Kreiss rkreiss at verizon.net
Mon Oct 26 07:29:56 PDT 2009



> -----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 Kenneth
> Brody
> Sent: Monday, October 26, 2009 9:21 AM
> To: rkreiss at gccconsulting.net
> Cc: filepro-list at lists.celestial.com; 'filePro Alpha Mailing List'
> Subject: Re: Lookup "gotcha"
> 
> Richard Kreiss wrote:
> [...]
> > The problem is when looping through the file, with the key being
> > street&address, her records are at the end of the file.  The program
loaded
> > the array but when it hit the NOT CLIST, the routing ended without
> > displaying the array.
> [...]
> 
> I'm not sure I see any "lookup gotcha" here.  It sounds like your code
just
> didn't handle the possibility of "not clist" being hit before running out
or
> matches.
> 
> Don't assume that "I hit EOF" means "I found no records".  When the loop
> terminates because of _either_ a mismatch or "not clist", then display the
> listbox if the count was not zero.
> 
> --
> Kenneth Brody

Ken,

I wasn't implying anything was wrong with what the what lookup did.  What I
had not considered was the end of file situation when looping to load the
array.  

There are two possible situations:
	1. No records in the call list file for that resident
	2. Records present but at the end of the index causing getnext to
execute the NOT clist.

This was my programming mistake in not qualifying the NOT statement more.

	1. Not clist and names["1"]=""	No records found; put up msgbox
"Call Resident"
	2. Not clist and name["1"] ne ""	Names present, put up list.

As I said, this was a "gotcha" error in that I had not accounted for both
situations.

I was trying to remind everyone to consider the possible situations which
would cause a lookup's NOT foobar to occur.

Richard




More information about the Filepro-list mailing list