GETNEXT and End of file error trapping

Scott Walker scottw1 at alltel.net
Thu Jul 28 09:50:05 PDT 2005


-----Original Message-----
From: filepro-list-bounces at lists.celestial.com
[mailto:filepro-list-bounces at lists.celestial.com] On Behalf Of Larry
Dannenberg
Sent: Thursday, July 28, 2005 8:03 AM
To: filepro Mailing List (filepro-list at lists.celestial.com)
Subject: GETNEXT and End of file error trapping



I am getting an end-of-file error that I can't seem to trap for. I tried
to use the hint in the "Developer's Reference", 4th Ed, Page 266 (line
94 in the example) but it didn't work for me.

 

When I enter a box number less that the last box number in the data set,
it works fine. (See partial listing of records in the data set).

 

How can I avoid the error when I am on the last record in the data set
and the next line has a "GETNEXT" in it?

 

 

Error Message

*** A filePro Error Has Occurred ***

 

On File: /u/appl/filepro/IMstore/prc.chooser

 

Input Processing

Line Number: 35

 

j=j+"1";getnext tre;nc=tre(10);goto loop3

^

Field not found.

Lookup has not been performed. 

 

Larry,

 

you need to check for the end of file after the "getnext tre" and
_BEFORE_ you try to do the assignment 

 "nc=tre(10)".

 

The way you have it now, it does not check for end of file until it goes
back to "loop3" which is _AFTER_ you try to do the assignment.

 

If: 

Then:    j=j+"1"

 

If:

Then:    getnext tre

 

If:          not tre

Then:     DO SOMETHING OTHER THAN THE NEXT LINE (end, return, etc....)

 

If:

Then:    nc=tre(10)

 

 

 Regards,

 

 

Scott

 



Scott Walker
RAM Systems Corp
Ph: (704) 896-6549
Fx: (704) 896-7458
scottw1 at alltel.net



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.celestial.com/pipermail/filepro-list/attachments/20050728/ce7cc2a1/attachment-0001.html


More information about the Filepro-list mailing list