0 pts.
 HOW DO YOU DISPLAY A CONTROL RECORD, A SUBFILE, AND A WINDOW AT THE SAME TIME WITHOUT THE USER HAVING TO PRESS ENTER TWICE?
RPG
WHEN A USER CHOOSES AN OPTION ON ONE SCREEN AND PRESSES ENTER, ANOTHER SCREEN WITH A CONTROL RECORD AND SUBFILE IS DISPLAYED. AS IT STANDS NOW, THE USER HAS TO PRESS ENTER AGAIN BEFORE A WINDOW IS DISPLAYED STATING, "ARE YOU SURE YOU WANT TO DELETE THIS RECORD?" IS IT POSSIBLE TO CODE A HARD RETURN IN MY RPGIV PROGRAM OR IS IT POSSIBLE TO CODE THE SDA FOR ALL 3 DISPLAYS (CTRLRCD, SF, & WINDOW) TO APPEAR WITH ONE RETURN? THANK YOU

Software/Hardware used:
ASKED: March 2, 2005  11:25 AM
UPDATED: October 20, 2009  5:03 AM

Answer Wiki:
To display the second screen: WRITE SFLCTLFMT (with both indicators for SFL and SFLCTL set on) EXFMT WINDOWFMT (assuming the OVERLAY keyword is on the window display format) If you need to read function keys that are defined on the SFLCTLFMT, then: READ SFLCTLFMT Thus, your RPG code should look like this: WRITE SFLCTLFMT EXFMT WINDOWFMT READ SFLCTLFMT ================================================================ The user presses [ENTER] twice because the programming requested it twice. Don't request input when the subfile and control record are displayed and the user won't have to supply it. Don't READ (nor EXFMT, which is a combined WRITE/READ) if you don't intend to wait for input. Just WRITE. And ensure that the display file is compiled DFRWRT(*NO) so that WRITEs cause data to be written to the device before READ requests are processed. Tom
Last Wiki Answer Submitted:  October 20, 2009  5:03 am  by  Bdfgsbw   0 pts.
All Answer Wiki Contributors:  Bdfgsbw   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Your request is somewhat confusing:

You say that “WHEN A USER CHOOSES AN OPTION ON ONE SCREEN AND PRESSES ENTER, ANOTHER SCREEN WITH A CONTROL RECORD AND SUBFILE IS DISPLAYED.”

I assume that we are interested in the “another screen” part; or is it that the user “chooses an option (4=Delete) and presses enter”? and you show a small window requesting confirmation of the delete (maybe a Y/N field?), and they press enter (the 2nd time) on that one?

If what you are trying to do is have the user avoid the confirmation (probably a bad idea, unless the users ALWAYS press enter without thinking), then just don’t write the confirmation window at all… If that isn’t the case, how about showing the code, so we can look at it, or break down the issue a little cleaner so we can evaluate it more completely.

BTW, note how I use upper and lower case in my response, and how I can create EMPHASIS by using upper case? Try it, sure makes reading easier and allows you to convey additional information quickly.

 0 pts.