Page 1 of 1
using SNDPGMMSG in CL frograms
Posted: Tue Jan 22, 2019 1:44 pm
by kmiles@misd.net
a lot of our CL programs use SNPPGMMSG to indicate job submitted to the user but this does not work when running from Genie. I tried to create a CL utility that sends a message to a display file window using cl program that shows a window using SNDRCVF RCDFMT(WINDOW01) WAIT(*NO). This works in the green screen environment but when it is run from genie it displays the message but requires the user to press enter before it proceeds to the next command. If there any work around for this?
Re: using SNDPGMMSG in CL frograms
Posted: Wed Jan 23, 2019 2:26 pm
by Scott Klement
Web browsers don't allow the server to change the web page without something being done in the browser to initiate it.
So, if the web page is sitting and waiting for input (including just the enter key or a function key, but also including input into fields) the server running on the IBM i cannot change the screen. It must wait until the uiser has submitted the page back to the server. Imagine if any web server on the Internet could change your screen at anytime without you even navigating to their site? It'd be unusable... so browsers don't allow it.
What you can do to work around this is write JavaScript code that submits the screen. For example, in the onload event you might use an "if" statement to look for a particular field/value on the screen that indicates that it should proceed without waiting, and if that's set, do pressKey("Enter").