GETNEXT and End of file error trapping

Nancy Palmquist nlp at vss3.com
Thu Jul 28 12:24:18 PDT 2005


GETNEXT and GETPREV do a lookup, so follow the same rules you would file 
to check for success that you would do after a LOOKUP line.

Here is a good example:

loop   if:
	then:  lookup det=invdet k=1 i=a -nxp
loop2  if: not det	'check to make sure it found something
	then: return
	if: det(1) ne 1
	then: return	'make sure you did not pass the match
	if:
	then:	'do what you need to do
	if:
	then: getnext det;goto loop2

Always test for finding a record and make sure it still matches what you 
want, on two different tests.  The -nx will match the first hit exactly, 
but getnext can run past the matches.

Nancy




-- 
Nancy Palmquist 		MOS & filePro Training Available
Virtual Software Systems	Web Based Training and Consulting	
PHONE: (412) 835-9417		   Web site:  http://www.vss3.com



More information about the Filepro-list mailing list