RonNoSpam wrote:Sorry if there's a better place to post this, but I couldn't find a forum for EHLLAPI, and this looked as a close as any other on this site.
My EHLLAPI program occasionally appears to return a partial PRESENTATION SPACE when "Copy Presentation Space (5)" function is called after sending "ENTER" to the mainframe screen. It looks like it's just not waiting for the mainframe screen to completely refresh before it tries to get the presentation space, so sometimes I get either the previous screen buffer or part of the next screen.
How can I ensure PCOM has completed processing and fully loaded the next mainframe screen?
Take a look at the EHLLAPI
Wait function. From the reference site (
http://publib.boulder.ibm.com/infocenter/pcomhelp/v5r9/index.jsp?topic=/com.ibm.pcomm.doc/books/html/emulator_programming08.htm, a direct link to the function doesn't work. Click on "EHLLAPI Functions", then on "Wait (4)"):
"The Wait function checks the status of the host-connected presentation space. If the session is waiting for a host response (indicated by XCLOCK (X []) or XSYSTEM), the Wait function causes EHLLAPI to wait up to 1 minute to see if the condition clears."
Basically, this function will wait until the system is ready for input. So, I'd write a loop that runs until the Wait function returns 0 (The system is ready for input).