|
Hi Douglas The following is an example of how you could do it, although I would use either Named Indicators or the Display Files INFDS to get away from using the *INxx indicators for the function key. I've assumed that *IN03 and *IN12 are the indicators assigned to the F3 and F12 keys respectively. * Repeat until F3 is pressed... C DoW *IN03 = *Off * If F12 wasn't pressed on Screen2 then initialise the * display... C If *IN12 = *Off C Eval SocSecNo = *Blanks C EndIf * Display the first screen... C Exfmt Screen1 * If F3 not pressed (i.e. Enter was pressed) then load * the Screen2... C If *IN03 = *Off * Check the Social Security No against the file... C SocSecNo Chain(E) SocSecFile * If a record was found then load the screen with the details... C If %Found(SocSecFile) C Eval ScreenName = NameFromFile C Eval ScreenDOB = DOBFromFile C Eval ScreenAddr = AddrFromFile * Otherwise use blanks, etc... C Else C Eval ScreenName = *Blanks C Eval ScreenDOB = *Zeros C Eval ScreenAddr = *Blanks C EndIf * Display the second screen... C Exfmt Screen2 * If Enter was pressed then validate the screen and update * the file... C If *IN03 = *Off and C *IN12 = *Off C Exsr Validate * If no errors then update the file... C If Errors = '0' (Work field from Validate S/R) C Eval SSNoFromFile = SocSecNo C Eval NameFromFile = ScreenName C Eval DOBFromFile = ScreenDOB C Eval AddrFromFile = ScreenAddr * Perform the file output... C If %Found(SocSecFile) C Update SocSecRec C Else C Write SocSecRec C EndIf C EndIf Errors = '0' C EndIf *IN03/*IN12 = *OFF C EndIf *IN03 = *OFF C EndDo All the best Jonathan www.astradyne-uk.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Douglas W. Palme Sent: 19 November 2004 15:59 To: RPG programming on the AS400 / iSeries Subject: Celaring values in display file fields I have created an RPGLE program that 1. displays a simple display file where the user enters in a social 2. The program then takes that social and then checks to see if the number exists in a physical file 3. If so it then displays a second display file with the data from the file, and if not it display the same second display file with blank values for the user to complete. On this second display file I have enabled the F12 function key to allow the user to move back to the first display file to re-enter a new social, but for some reason when you do this, it displays the SECOND display file with the same data it did the first time? How do I clear those fields so this doesn't happen?
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.