See if this works for you.
In DDS Ctl Record
SFLPAGELST 4S 0H SFLRCDNBR(CURSOR)
In RPG Src
Dcl-f VarShpInqF Workstn InfDS(DspInfDS)
Dcl-Ds DspInfDS;
SflPageRrN Int(5) Pos(378);
End-ds;
// Init SubFile Control
SflClear = True;
Write ListCtl;
SflClear = False;
SflPageLst = 1;
After Exfmt
If SflPageRrN = 0;
SflPageLst = 1;
Else;
SflPageLst = SflPageRrN;
EndIf;
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Francois Lavoie
Sent: Friday, January 31, 2020 1:51 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Determine Subfile Page
SFLRCDNBR (Subfile Record Number) keyword for display files You use this field-level keyword on the subfile-control record format to specify that the page of the subfile to be displayed is the page that contains the record whose relative record number is in this field.
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Tim Adair
Sent: Friday, January 31, 2020 14:32
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Determine Subfile Page
True or False? If a subfile has no input fields, it is impossible for the RPG program to determine which 'page' the subfile is on.
Example: I have an invoice lookup program with a subfile that has no input fields - it just shows one line of information per invoice. The subfile control record has a single input field where the user can type in and invoice number and go to a screen that shows the invoice detail information. When the user presses F12 to return from that screen, they want to go back to the subfile 'page' that they came from (and not back to the beginning of the subfile, which is what the program is currently doing).
If I can determine the subfile's current 'page' then I can force the subfile back to the 'page' the user came from.
How can this be done if the subfile has no input fields? SFLCSRRRN doesn't help because the cursor is never within the subfile.
Thanks in advance for any thoughts on this.
~TA~
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You
WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<
http://www.walzcraft.com> Phone: 1-800-237-1326
As an Amazon Associate we earn from qualifying purchases.