Subfile Question
_____
size=2 width="100%" align=center>
<
http://archive.midrange.com/rpg400-l/200810/msg00349.html##> -
* Subject: Re: Subfile Question
* From: "sjl" <sjl_abc@xxxxxxxxxxx>
* Date: Fri, 17 Oct 2008 15:41:15 -0500
* List-archive: <
http://archive.midrange.com/rpg400-l>
* List-help: <mailto:rpg400-l-request@xxxxxxxxxxxx?subject=help>
* List-id: RPG programming on the AS400 / iSeries
<rpg400-l.midrange.com>
* List-post: <mailto:rpg400-l@xxxxxxxxxxxx>
* List-subscribe:
<
http://lists.midrange.com/mailman/listinfo/rpg400-l>,
<mailto:rpg400-l-request@xxxxxxxxxxxx?subject=subscribe>
* List-unsubscribe:
<
http://lists.midrange.com/mailman/listinfo/rpg400-l>,
<mailto:rpg400-l-request@xxxxxxxxxxxx?subject=unsubscribe>
<
http://www.addthis.com/feed.php?pub=midrangedotcom&h1=http%3A%2F%2Ffeeds.mi
drange.com%2Frpg400-l&t1=> AddThis Feed Button
<
http://www.addthis.com/bookmark.php>
_____
Mike wrote:
I haven't done this in years. On a subfile with many pages, the user wants
the position to return to where it was. I am filling the whole subfile
with
all of the data then letting the
<
http://archive.midrange.com/rpg400-l/200810/msg00349.html> system handle
paging. How do I keep the
right page of records up that the user left?
Mike-
To get the subfile record number that the
<
http://archive.midrange.com/rpg400-l/200810/msg00349.html> cursor is
currently in, use the
SFLCSRRRN keyword on the subfile control record format.
To reposition the subfile to the page containing this record number, use the
SFLRCDNBR(CURSOR) keyword on the subfile control record format.
- sjl
Mike,
Sjl is correct, here's an example
A R CTL SFLCTL(SFL)
A*%%TS SD 19960529 094136 RHARVEY REL-V3R0M5 5763-PW1
A SFLSIZ(0025)
A SFLPAG(0010)
A HELP
A BLINK
A KEEP
A CSRLOC(SETROW SETCOL)
A SFLCSRRRN(&GETRRN)
A SFLRCD 4S 0H SFLRCDNBR
A GETRRN 5S 0H
A SETROW 3S 0H
To retrieve the record the cursor was on
*
* Retrieve SELECTED SUBFILE RECORD
*
C GETRRN CHAINSFL
*
* To position the subfile to the page the user was on
*
C EVAL SFLRCD = GETRRN
C EXFMT CTL
*
* To position the subfile with the selected record on top
*
A SFLRCD 4S 0H SFLRCDNBR(CURSOR)
*
* If this program is calling other programs
* To always be sure the user returns to the same page they left
* Use the File information data structure
FCM0200D CF E WORKSTN KINFDS INFDS
*
* File Information Data Structure
*
IINFDS DS
I 369 369 USRKEY
I B 370 3710CURSOR
I B 378 3790FSTRRN
I B 380 3810LSTRRN
I B 382 3830WDWCSR
FSTRRN is the subfile record number of the current page displayed
C EXFMT CTL
C EVAL SFLRCD = FSTRRN
If you move another record # into SFLRCD, that record will be on the page
If not the user will always return to the page they were viewing before
Leaving this program
Hope this helps
Ron Harvey
(Old but still breathing)
As an Amazon Associate we earn from qualifying purchases.