× 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.



Hi,

>>sure it does.  You may need to add the screen line number of the
>>beginning of the subfile, plus the remainder of the subfile record
>>number divided by the page size of the subfile.

it's even easier.
You simply have to add the keyword SFLCSRRRN(Field) to your DDS.
Field must be defined as 5S 0 hidden field.
Field contains the relative record number the cursor is positioned to.
If the cursor is positioned outside the subfile Field contains *Zeros.
To reposition on the current subfile record, the information stored in field
must only be moved to the field defined with SFLRCDNBR(CURSOR).

The actual cursor position, row, column on the screen is returned in the
file status data structure, position 370, 371 in binary.

The following example shows how to reposition after pressing the function
key F04=Match code.
1. DDS:
A          R LL4011C1                  SFLCTL(LL4011S1)
A*%%TS  SD  19990908  095427  HAUSER      REL-V4R4M0  5769-PW1
A                                      PAGEDOWN(55)
A                                      CF04
A                                      CF17
A                                      CF18
A                                      RTNCSRLOC(&C1RCDN &C1FELD)
A                                      CSRLOC(C1CSZE     C1CSSP)
A                                      SFLCSRRRN(&C1RSNR)
  ... other key words
A            C1RSF          4S 0H      SFLRCDNBR(CURSOR)
A            C1RSNR         5S 0H      TEXT('Current Subfile Record No)
A            C1RCDN        10A  H      TEXT('Format Current Cursor
Position')
A            C1FELD        10A  H      TEXT('Field Current Cursor Position')
A            C1CSZE         3S 0H      TEXT('Cursor Row for Positioning')
A            C1CSSP         3S 0H      TEXT('Cursor Column for Positioning')
  ... other fields

RPG:
FLL4011F   CF   E             WORKSTN INFDS(SAVINF)
F                                     SFILE(LL4011S1:S1RSF)
F                                     SFILE(LL4011S4:S4RSF)
 *-----------------------------------------------------------------
D SAVINF          DS
D  AidCode              369    369

D  CsrRow               370    370I 0
D  CsrColumn            371    371I 0
 *-----------------------------------------------------------------
 /Free
    ExFmt LL4011C1;
    Select;
    When AidCode = F04 and C1RSNR <> *Zeros;
         Chain(E) C1RSNR LL4011S1;
         If %Found;
            Select;
            When C1FELD = 'S1FLD1'
                 //Execute MatchCode for FLD1
            When C1FELD = 'S1FLD2'
            ....
            EndSL;
        EndIf;
        C1RSF  = C1RSNR;  //Reposition on Subfile Record
        C1CSZE = CsrRow;  //Reposition on Row on Screen
        C1CSSP = CsrCol;  //Reposition on Column on Screen
      EndSL;

Mit freundlichen Gruessen / Best regards

Birgitta

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les Brown)

-----Ursprungliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Booth Martin
Gesendet: Freitag, 13. Januar 2006 23:04
An: RPG programming on the AS400 / iSeries
Betreff: Re: Changing ROW COL on DDS


sure it does.  You may need to add the screen line number of the
beginning of the subfile, plus the remainder of the subfile record
number divided by the page size of the subfile.

c   eval rownbr = (screenLineNumber) + %rem(SFLRRN/pagesize)

Douglas W. Palme wrote:
> I have been reviewing that but it appears that it does not work with
> subfiles, correct?
>
>
> On Fri, 13 Jan 2006 15:19:26 -0600, Booth Martin wrote
>> Look at the CSRLOC keyword which positions the cursor to row & column.
>>
>> Douglas W. Palme wrote:
>>> I need to programmatically change the cursor position and since I have
> the
>>> rtncsrloc already pulled into the DDS, can someone point me in the right
>>> direction on how to do this?
>>>
>>>
>>>
>> --
>> -----------------------------------
>> Booth Martin
>> http://martinvt.com
>> -----------------------------------
>> --
>> This is the RPG programming on the AS400 / iSeries (RPG400-L)
>>  mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
>> subscribe, unsubscribe, or change list options, visit:
>> http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-
>> L-request@xxxxxxxxxxxx Before posting, please take a moment to
>> review the archives at http://archive.midrange.com/rpg400-l.
>
>
> If you bought it, it was hauled by a truck - somewhere, sometime.
>

--
-----------------------------------
Booth Martin
http://martinvt.com
-----------------------------------
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.