read prior loop EoF

General development discussion.

Moderators: Susan Smith, admin, Gabriel

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

read prior loop EoF

Post 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
John Bowman
David Bohlke
Posts: 4
Joined: Mon Jun 08, 2009 9:58 pm

Re: read prior loop EoF

Post 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
John
Posts: 554
Joined: Sun Apr 26, 2009 8:27 am
Location: West Orange, NJ
Contact:

Re: read prior loop EoF

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