|
Why not just use READC and update the subfile record? This works for me: Dou %EOF(Ars945Fm); Readc Dtacde; If %EOF(Ars945Fm); Input = Cancel; Leave; Endif; Exsr Edtcde; // Only the first selection is returned. If Codereturn <> *BLANKS And Not Displayerror; Leave; Endif; Enddo; Begsr Edtcde; // Assume no errors Grouperror = *OFF; If Cdeopt <> *BLANK And Cdeopt <> '1'; Sndmsg ('AR00156'); Displayerror = *ON; Grouperror = *ON; Endif; If Cdeopt = '1'; Groupslc = Group; Codereturn = Code; Endif; Update Dtacde; Endsr; Francis Lapeyre IS Dept. Programmer/Analyst Stewart Enterprises, Inc. E-mail: flapeyre@xxxxxxxx -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin Sent: Thursday, March 8, 2007 12:17 PM To: RPG programming on the AS400 / iSeries Subject: Invalid subfile options and SFLMSG Invalid subfile options and SFLMSG Time to get a tad smarter. Not necessarily smart, just smarter than I am this morning. OK, here's the scenario: A subfile with a subfile option field so one can key in a '2' to edit, '4' to delete, '5' to view, etc. I've added a validity checking subroutine to be sure the user keyed in a valid value ('2','4', '5' for instance). I do a "for" loop and test each subfile record. If the option does not validate then I turn on *in70 and update the subfile before continuing the loop. After the "for" loop there is no further processing, and the screen is exfmt'd again. Everything works fine so far as I can see, excepting one problem that I can not figure out how to solve. In testing, if I key several invalid options and press enter, it returns the error message and places the cursor on the first error of the subfile. Fine so far. Now, if I fix the first invalid option but none of the others, and then enter, the cursor goes to the corrected field and still shows as an error.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.