RATE THIS ANSWER
0
Click to Vote:
0
0
Hi S22
You've chosen to create tricky little piece of code.
The duplicate records make it impossible to find your place if you move the record pointer in other processing.
So any other processing should be by another access path.
When you initially load the subfile you probably read one extra record so you can set the *more indicator
That extra record would be the initial read for the page down.
Load Routine (used initially, used on page down, used after pageup routine
1. Clear Subfile
2. record# = 1
2 while record# <= subfileMax and not eof(myfile)
3. load first record
4. read myfile
5. record# += 1
6. enddo
and you've got the one extra record to set the *more indicator.
PageUp -- uses readp to walk up the file to the correct position\
record# = 1
while record# <= subfileMax+1 and not eof(myfile)
READP myfile <-- backup into the file
record# += 1
Enddo
if %eof(myfile)
setll (xxx) myfile <-- use low value if it weren't keyed
endif
Read myfile
then do the routine above to load.
the Setll is required because when the readp reaches top of file the pointer is not positioned to read the first record.
Good luck
Phil
/////////////////////////
ohhhh ... page up error... while record# <= subfileMax+1 and not eof(myfile)
that only gets to the top of the current page .. should be:
while record# <= 2 * (subfileMax) +1 and not eof(myfile)
///////////////////////////
Yorkshireman has a good point but I don't think it can work quite like he suggested, not if you want to load the data using a keyed data set. However, his record number could be used on a second access path without the key
That would be used to access the records for updating/deleting.
Phil
Last Answered:
Feb 20 2009 7:10 PM GMT by Philpl1jb 
24600 pts.