|
Hi Luqman, As you have defined you subfile for Size = Page = 10 Then you can simply position for a particular subfile record Eval *In40 = *On --- DSPATR(PC) Eval SFLNXTCHG indicator = *On Update Subfile record format You may also define SFLRCDNBR for Size = Page The below is explained when Size > page In DDS Code Please paste the below line after SFLCSRRRN(&RRRN) line A RCDNBR 4S 0H SFLRCDNBR(CURSOR) If you pass the RRN number to the SFLRCDNBR, say RRN = 1 and your subfile page (SFLPAG)= 8 Then it will display records from Record number one to Eight, and if the user presses Page Down key Then RRN = 9 and when passed to SFLRCDNBR it will display From Record number Nine and plus eight records and so on ... If you have scroll down for number of records and now trying to process a particular record and RRN number is not known then SFLCSRRRN will return the RRN number , when this number is passed to SFLRCDNBR you could able to display the desired page and position the cursor as desired when Subfile record format is updated. If you donot define SFLRCDNBR then the first page of the subfile is displayed and The desired result is not achieved As Dave explains in his mail SFLRCDNBR(CURSOR *Top) makes to display as the first record Or only defined SFLRCDNBR(CURSOR) would place the cursor at the stated position Thanks Sadiq .. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Luqman Sent: Thursday, April 06, 2006 4:05 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: How to position cursor on particular row of subfile in code ? Dear Mr. Sadique, I would like to share my DDS Code with you, so that you can evaluate what am I missing, please. Is it necessary to define SFLRCDNBR as I did not find this keyword in STRSDA. Please advise what am I missing ? I have used SFLCSRRRN for cursor positioning. 0000.30 A DSPSIZ(24 80 *DS3) 0000.40 A INDARA 0000.50 A R SUBFILE SFL 0000.70 A 41 SFLNXTCHG 0000.80 A MLNAME 35A O 8 18 0000.90 A MLCODE 5Y 0B 8 8EDTCDE(4) 0001.00 A 40 DSPATR(PC) 0001.10 A MQTY 5Y 0B 8 55EDTCDE(4) 0001.20 A R SUBFILECTL SFLCTL(SUBFILE) 0001.40 A CA12(12 'EXIT') 0001.50 A RTNCSRLOC(*RECNAME &REC &FLD &POS) 0001.60 A SFLCSRRRN(&RRRN) 0001.70 A SFLMODE(&MODE) 0001.80 A SFLDSP 0001.90 A SFLDSPCTL 0002.00 A 66 SFLCLR 0002.10 A 02 SFLEND(*MORE) 0002.20 A SFLSIZ(0010) 0002.30 A SFLPAG(0010) 0002.50 A 6 8'LOCN' 0002.60 A 7 8'CODE' 0002.70 A 7 18'LOCATION NAME' 0002.80 A 7 55'QTY' 0002.90 A FLD 10A H 0003.00 A MODE 1A H 0003.10 A REC 10A H 0003.20 A POS 4S 0H Best Regards, Luqman "MD, Sadique" <Sadique.MD@xxxxxxx> wrote in message news:1C65F47D22F9F6498EC408D33101F34F01AEBD34@xxxxxxxxxxxxxxxxxxxx > Hi Luqman, > > One easy way of positioning cursor on a subfile record is By defining > Position Cursor (DSPATR(PC)) for that particular field > > Do While not Exitkey > Exfmt subfileCtl > > For any errors/Process > Eval (DSPATR(PC)) indicator = *On > If SFLCSRRRN > *Zeros (SFLCSRRRN will return the RRN number of the > cursor > positioned) > Eval SFLRCDNBR = SFLCSRRRN > End If > Eval SFLNXTCHG indcator = *On > Update Sufile Record Format > > EndDo > > Thanks > Sadiq .... > > > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] > On Behalf Of Luqman > Sent: Thursday, April 06, 2006 1:08 PM > To: rpg400-l@xxxxxxxxxxxx > Subject: How to position cursor on particular row of subfile in code ? > > How can I position the cursor on particular Row of Subfile in code ? > > I have defined rrrn, fld and rec hidden fields in SFLCSRRRN and RTNCSRLOC. > > What I have not used is Cursor Position of RTNCSRLOC, do I have to use this, > if so, how ? > > > What I need to do is that whenver the user press Enter Key, the Cursor > should come on the same row, from where it left ? > > My code is as under:- > > Do While not Exitkey > Exfmt subfileCtl > RRRN Chain Subfile > Eval myCode=CodeField > Eval myName=NameField > Enddo > > Best Regards, > > Luqman > > > > -- > 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. > -- > 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. > > -- 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 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.