Page 1 of 1

read prior loop EoF

Posted: Sun Aug 16, 2020 9:30 am
by John
:D Here's one for you BR! Gurus :D

In the following pseudo-code loop:

Code: Select all

read, key=whatever
do
  read, prior: etc
loop
How do I test to see if I hit the beginning of the file? I need it to not loop forever but quit at the start of the file, the do loop seems to be looping eternally.

:?:
John

Re: read prior loop EoF

Posted: Sun Aug 16, 2020 10:18 am
by David Bohlke
It sounds counter-intuitive, but EOF works for beginning of file on a READ PRIOR
READ #1,using xx,PRIOR:Var1 EOF wherever

Re: read prior loop EoF

Posted: Sun Aug 16, 2020 11:59 am
by John
Thanks! I found my loop outside of that little routine, but I sure thought it was hanging up there for the longest time. It is a bit counter-intuitive, but it sure does work.

-John