Bad getnext?

Jeff Harrison jeffaharrison at yahoo.com
Fri Oct 14 11:30:12 PDT 2005


--- Tyler Cameron Style <cmaitson at telus.net> wrote:

> 
> I am having an odd problem.  I am doing a lookup to
> a file that I want
> to iterate through all records for.  Since this is a
> library function,
> I don't want to use indices for this lookup.  I look
> up the file using
> record# 1.  Fine and dandy so far.
> 
> I then use a loop to iterate through the records,
> using a getnext:
> 
[snip]

> 
> However, when it gets to the last record, I get an
> error (in this
> instance original & backup are lookups to ncust):
> 
> *** A filePro Error Has Occurred ***
> 
> On File: /hd1/hd1/appl/filepro/ncust/indexhh.A
> 
> Output Processing
> Line Number: 53
>    Record Number: 1
> Lookup File Name: ncust
>     Using Record:
> 
> 
> Lookup failed.
> Correct the key field(s) and try again.
> 
> Why is this?  Especially since I am not even using
> indexhh.A for
> original - I should be iterating through the records
> with no index.
> The getnext should just set original to be null, so
> that the condition
> at loop02s can be tested and the loop exited. 
> Instead, it bombs out.
> I usually iterate using indices, and I've never
> encountered this
> problem before.  Is it related to the fact that I am
> iterating using
> record#?  If so, how the heck do you tell when
> you've reached the end
> of the file, then?
> 
>      Tyler
> 

You are using the -e flag on your "original" lookup. 
Do you still get the error if you change it to a -n ?

If so then I would say it is a bug.

You mentioned that it is a library routine so you
can't use an index - can't you pass the index letter
in a variable to your library routine?  It would be
much more efficient if you could.

Jeff Harrison
jeffaharrison at yahoo.com

Author of JHExport and JHImport.  The easiest and
fastest ways to generate code for filePro exports and imports.


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


More information about the Filepro-list mailing list