|
READC is used to read only the records that the user changed (keyed data into) in your subfile. The SFLNXTCHG keyword can be used to programmatically mark a record as "changed", if you don't want the user to have to manually change it. That's all well and good, but has nothing to do with the F4 example that you gave! You're trying to find out "which record was the cursor on when the user pressed F4", and not "which records have been changed?" Here's how you determine where the cursor left off: In your DDS, specify the SFLCSRRRN keyword. For example: At record level: A SFLCSRRRN(&CURSORPOS) At field level: A CURSORPOS 5S 0H Then, in your RPG, when F4 has been hit do something like this: c eval recno = cursorpos C* recno is the record number you specified on the SFILE keyword C* on your F-spec. c recno chain subfile c if %found C* now the subfile record where the user pressed F4 has been loaded C* into memory. do whatever you wanted to do when F4 was pressed C* here. c endif On Tue, 2 Apr 2002 KWhite@focalsystems.com.au wrote: > I am writing a subfile which looks similar to the following. > > Opt Order Qty Reason Notes > __ 12345 6 __ Test Test Test > __ 45656 8 __ Test To Test To > > My program basically loads the subfile > > Eg. EXSR $WS01 (this formats the data and writes each > subfile record > WRITE S01C > EXFMT S01 > > Then I do READC S01 to determine subfile changes - the user may choose to > place a one in one or many of the option fields or select F4=List to prompt > on a reason code. > > Has anyone got an example of how this is done. I tried the SFLNXTCHG > indicator but in all the reading I have found it to be quite confusing and > am encountering multiple problems with not knowing which relative record > number I am at when selecting F4 etc. Basically I am in a big mess. I > think I have two separate problems here. 1) I don't have the SFLNXTCHG > keyword processing correct in my RPG and 2) I don't know how to process a > function key on a subfile. > > All I want to do is be able to do an F4 on the reason and have the code > returned from a selection list to the correct subfile line selected from > and if there are any errors - eg the user enters in the wrong code then > that line is highlighted and not processed and the subfile is re-written > showing the errors and removing those items already processed. > > Any help would be appreciated. >
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.