read prior loop EoF

General development discussion.

Moderators: Susan Smith, admin, Gabriel

John
Posts: 554
Joined: Sun Apr 26, 2009 8:27 am
Location: West Orange, NJ
Contact:

read prior loop EoF

Postby John » Sun Aug 16, 2020 9:30 am

: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
John Bowman

David Bohlke
Posts: 4
Joined: Mon Jun 08, 2009 9:58 pm

Re: read prior loop EoF

Postby David Bohlke » Sun Aug 16, 2020 10:18 am

It sounds counter-intuitive, but EOF works for beginning of file on a READ PRIOR
READ #1,using xx,PRIOR:Var1 EOF wherever

John
Posts: 554
Joined: Sun Apr 26, 2009 8:27 am
Location: West Orange, NJ
Contact:

Re: read prior loop EoF

Postby John » Sun Aug 16, 2020 11:59 am

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
John Bowman


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 2 guests

cron