Hi dale. Is this a WDW type format? Are you using CAnn or CFnn in your program? -Mean 1
Hi dale. Is this a WDW type format? Are you using CAnn or CFnn in your program? -Mean 1
Yes, there is a window keyword in the subfile control record. The detail screen (not a subfile) had CF01. I changed to CA01. (There are no CA or CF on the window subfile control record, just the usual indicators for subfile display, initialize, etc.) Neither change to the detail screen made any difference. Once the F1 key is pressed, the original (detail) screen does not reapppear.
As I am not a fan of RSTDSP(*YES), I have created several instances similar to your situation. In ALL my instances, the Window program is a separate program that accepts parameters (this way I can utilize from multiple calling points), but it still work the same. Once returning from the prompt to the window, I perform an ITER which then begins my DO loop over and the first operation is an EXFMT of the screen from where the prompt started. If you need additional help, please contact me yarringl@sasinc.com
Hi Dale, Did you define a record format using the keyword ASSUME? Birgitta
I have added a dummy record format with keyword ASSUME but it changed nothing. I have OVERLAY in all my screen formats. I compiled with RSTDSP *yes. In my RPG program, I EXFMT the add screen. At some point during the add screen subroutine the user presses F1 and the window subroutine is executed. The window subroutine loads the display file and then does EXFMT. The cursor position RRN is used to chain to the subfile and gets the data (only 1 field on the window subfile) and move it to the add screen field name. When enter is pressed, the program returns to the step after the add screen and only the data moved from the window subfile has been added to the record, all other fields are blank. The window subr is doing what it's supposed to , I just can't get it to work with the rest of the program. Perhaps making the window selection a separate program would work better. ---Dale
I am trying to complete a subfile program by adding a window to select a constant. The program has 3 subfiles (one is the window). Basic logic is user looks at data in either subfile 1 or 2. When (s)he wants to add a record, press Cf key, get add screen. When add screen is displayed, user presses F1 to view the window subfile, positions cursor, presses enter. The rpg400 pgm moves data from window to add screen record, but the program does not return to the add screen so the user can continue entering data. Instead, the program acts as if enter was pressed on the detail screen. The data is moved from the window to the detail screen ok. I have compiled the screens with restore display (RSTDSP *yes). I have added a dummy record to the screen file with the KEEP keyword. I have tried puting the KEEP keyword in the detail screen. What is the trick to restore the detail screen? Right now, the field that uses the window to get data is in the middle of the detail screen, but I could put it first if that would help. What must I do do get back to the detail screen (hopefully with the cursor positioned at the next field to be entered)
For anywone following this thread, I found two necessary steps to make myh program work. First, the function key must be CF not CA, so data is returned to the program. Then the screen must be read again with EXFMT after the window pop up subrouting is finished. Once I had these in place, the program worked the way I wanted it to. ---Dale