Okay, thanks for posting that... that helps a lot.
Looks like you are using SNDPGMMSG two different ways in this example. Here's the first one:
Code: Select all
SNDPGMMSG MSG('G/L Monthly Transaction Summary was +
Cancelled.')
This should work exactly the same in Genie as it does in green-screen. What it does is send an *INFO message to the caller's message queue. If this is called from the command-line or a menu, that will result in the message being displayed at the bottom of the screen. (Should be exactly the same in Genie.)
Here's the other way you are using SNDPGMMSG:
Code: Select all
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) +
MSGDTA('Saving files as Backup...') +
TOPGMQ(*EXT) MSGTYPE(*STATUS)
This sends a status message to the job's external (*EXT) message queue. In this instance, Genie will behave a little bit differently than a typical green-screen because Genie is running in a web browser. Normally, when a status message is sent to the external message queue in an interactive job (it's different in a batch job) the OS will print the message at the bottom of the 5250 window. The way it works is that the OS sends a signal to the 5250 emulator to stop displaying the screen that it's currently displaying, and then tells it to re-display the screen with the message on it.
However, in a web browser, we have a bit of a problem. The only time a web server can tell a browser to display a screen is when the browser asks for it. So if a browser says to a server "I want to display the web page at (insert URL here)" the server sends it the proper data, and the browser displays it, and all is well. So that's what happens when the user hits enter or a function key (etc) inside Genie, the browser asks the srever for the next screen to display, and all is well. However, it's not possible for the server to change what's on the browser's display without the browser asking for it. (Imagine if any web server in the world could display something on your screen without you having to first ask to see their web site... that'd be horrible!)
In the case of a status message, though, that's exactly what it'd need to do. The user hasn't clicked anything... so the browser isn't going to ask the server to re-display with the message. It doesn't know that the CL program has sent a status message... only the server knows that, and the server can't initiate the screen display.
So what Genie does is "remember" what the status message is. The next time the user asks for a new screen, Genie will send that message across (unless that part of the screen has been blanked out in the mean time.) But there's no way for Genie to redraw the screen until the user asks for it.
Sorry for the long winded reply... hope it makes sense.