× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



As far as I can tell, SFLCSRRRN is an input only keyword, and does not
affect anything on output. You use SFLRCDNBR to set the subfile page to be
displayed. When I need to know which subfile record is the first one the
screen when the user presses enter (or another command key), I get that out
of the file feedback area. I believe it is somewhere around position 377.
Here is how I have my feedback area defined:

// Display Feedback area templates
dcl-ds dspf_fb_t Qualified Template;
file LikeDs(file_t);
opn LikeDs(dspf_open_t);
io LikeDs(io_t);
dsp LikeDs(display_t);
end-ds;

dcl-ds File_t Len(80) Qualified Template;
FileName Char(8); // *FILE
FileOpen Ind; // File Open Indicator
EndOfFile Ind; // End of File
Indicator
Status Zoned(5:0); // *STATUS
Operation Char(6); // *OPCODE
Routine Char(8); // *ROUTINE
Statement Char(8); // Source line/stmt
number
Record Char(8); // *RECORD
MessageId Char(7); // Machine or system
message number
ScreenSize Zoned(4:0) Pos(67); // *SIZE
KeyboardType Zoned(2:0); // *INP
DisplayType Zoned(2:0); // *OUT
Mode Zoned(2:0); // *MODE
SourceId Int(5); // Source ID
end-ds;

dcl-ds Dspf_Open_t Len(160) Qualified Template;
OdpType Char(2); // ODP Type
FileName Char(10); // File name
FileLibrary Char(10); // Library name
MaxRecordLength Int(5) Pos(45); // Max record len
FileType Int(5) Pos(67); // File type
NumberOfLines Int(5) Pos(72); // Num PRT/DSP rows
NumberOfChars Int(5); // Num PRT/DSP cols
MaxBlockRecords Int(5) Pos(106); // Max rcds in blk
BlockIncrement Int(5) Pos(110); // Blk increment
Flags1 Char(1) Pos(116); // Misc flags
RequesterDevice Char(10); // Requester name
FileOpenCount Int(5); // Open count
Flags2 Char(1) Pos(133); // Misc flags
OpenId Char(2); // Open identifier
MaxFormatLength Int(5); // Max rcd fmt len
Ccsid Int(5); // Database CCSID
Flags3 Char(1); // Misc flags
DeviceCount Int(5) Pos(147); // Num devs defined
end-ds;

dcl-ds Io_t Len(126) Qualified Template;
WriteCount Int(10) Pos(3); // Write Count
ReadCount Int(10); // Read Count
WriteReadCount Int(10); // Write-Read Count
OtherOpCount Int(10); // Other Operation
Count
CurrentOperation Char(1) Pos(20); // Current Operation
RecordFormat Char(10); // Record Format
DeviceClass Char(2); // Device Class
DeviceName Char(10); // Device Name
RecordLength Int(10); // Record Length
end-ds;

dcl-ds Display_t Qualified Template;
Flags1 Char(2); // Bit Flags
Key Char(1); // Attention Indicator
Byte (key press)
CursorRow Int(3); // Cursor Location -
Row
CursorCol Int(3); // -
Column
DataLength Int(10); // Data Length
SflRrn Int(5); // Subfile Relative
Record Number
MinSflRrn Int(5); // Lowest Subfile
Record on screen
SflRecordCount Int(5); // Total Records in
Subfiles
WndCursorRow Int(3); // Cursor Location
- Row
WndCursorCol Int(3); // relative to window
- Column
MajorReturnCode Char(2) Pos(35); // Major return code
MinorReturnCode Char(2); // Minor return code
end-ds;

If I need to maintain the subfile on screen in the same position it was
when I started, I will capture dspf_fb_t.dsp.MinSflRrn immediately after
the read. Then I can set SFLRCDNBR with that value to put the same subfile
record on the top of the screen on the next write of the subfile control.

On Sat, May 5, 2018 at 8:20 AM, Dave <dfx1@xxxxxxxxxxxxxx> wrote:

Thanks guys, I know how to implement the keyword, that wasn't the question.

I have a subfile with one input field. When you enter something in the last
record displayed, the cursor advances to another input field in the subfile
control record and SFLCSRRRN therefore returns 0. In my program, I set it
to 1 and so the first page gets shown again every time the screen is
re-displayed.
SFLSCROLL looks like it might be what I need although I'm not using ROLLUP.

2018-05-04 21:09 GMT+02:00 Jose Perez <joseenocperez.jp@xxxxxxxxx>:

SFLCSRRRN – Return the cursor position,
sometimes I use it like this: user select a row on the subfile but the
selection was done with an option that is not allow on the subfile then I
can show up the msg on the bottom of the screen and at the same time
point
out the user on the exact row where the error is on the subfile using
SFLCSRRRN, what matter is the relative record number, where it is on the
subfile. Combined with SFLRCDNBR(CURSOR) it helps to position the cursor
exactly on the row of the current subfile page where you are actually.


On Fri, May 4, 2018 at 2:14 PM Dave <dfx1@xxxxxxxxxxxxxx> wrote:

Hello,



What would be the correct way to manage a subfile that uses this
keyword?
You can test the value returned against 0 so that you set the RRRN to 1
in
case the cursor was outside the subfile record fomat.


That's fine if you were on page 1 of the subfile, but what if you
aren't?


Thanks
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.