last record by key

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

last record by key

Post by Gabriel »

Is there any easy fast way to read the last record in a file by key??
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

It's been years since I've needed to do this, but can't you just:

READ #fileno1,using form$(fileno),LAST:mat f$,mat f

If you want to traverse the entire file backwards;

RESTORE #fileno,LAST:
Loop:
READ #fileno,using form$(fileno),PRIOR:mat f$,mat f
...

-- Susan
Post Reply