Is the Pause statement really as useless as it seems?

Posted by tbergman on 23-May-2014 07:57

Progress 11.3.2 It was long, long ago on a planet far, far away when I last really used the Pause statement (character development). When I read that 11.2+ now supported sub-second pause, I thought it might be useful. So, I tried it out in a class that was accessing an exe I'd just launched that needed a wait loop to be ready before I could access some of the Process properties. Pause no-message puts a progress window on the screen, obviously not useful. Before-Hide makes it not pause at all as demonstrated by the code below. I found some kbase's that seem to confirm this conclusion. Do I really need a window with a status-bar to use the pause statement? Since I'm in Windows it's certainly easy enough to just use System.Threading.Thread:Sleep(10) but is there really no way to get a usable pause in the Progress language? DEFINE VARIABLE i AS INTEGER. etime(true). DO i = 1 TO 100: PAUSE .01 before-hide. END. MESSAGE etime VIEW-AS ALERT-BOX. Tom

All Replies

Posted by tbergman on 23-May-2014 08:03

The original post had plenty of line breaks when I wrote it. Not sure why they are lost. Trying again... Progress 11.3.2 It was long, long ago on a planet far, far away when I last really used the Pause statement (character development). When I read that 11.2+ now supported sub-second pause, I thought it might be useful. So, I tried it out in a class that was accessing an exe I'd just launched that needed a wait loop to be ready before I could access some of the Process properties. Pause no-message puts a progress window on the screen, obviously not useful. Before-Hide makes it not pause at all as demonstrated by the code below. I found some kbase's that seem to confirm this conclusion. Do I really need a window with a status-bar to use the pause statement? Since I'm in Windows it's certainly easy enough to just use System.Threading.Thread:Sleep(10) but is there really no way to get a usable pause in the Progress language? DEFINE VARIABLE i AS INTEGER. etime(true). DO i = 1 TO 100: PAUSE .01 before-hide. END. MESSAGE etime VIEW-AS ALERT-BOX. Tom

Posted by Matt Gilarde on 23-May-2014 08:59

Historically, the PAUSE statement has required a visible window so that the user can cancel the PAUSE. 11.3 introduced the -pausefix startup parameter. When -pausefix is used OpenEdge won't make a window visible when executing the PAUSE.

Posted by ChUIMonster on 23-May-2014 09:26

Historically you've been able to use PAUSE quite effectively in completely headless environments so that window requirement makes no sense.


On 5/23/14, 10:00 AM, Matt Gilarde wrote:
Reply by Matt Gilarde

Historically, the PAUSE statement has required a visible window so that the user can cancel the PAUSE. 11.3 introduced the -pausefix startup parameter. When -pausefix is used OpenEdge won't make a window visible when executing the PAUSE.

Stop receiving emails on this subject.

Flag this post as spam/abuse.



-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com

Posted by Matt Gilarde on 23-May-2014 09:38

I didn't say that it made sense. The PAUSE statement is aware of when it is running in a headless environment (appserver agent, batch, etc.) and doesn't require a window in those cases. Long ago someone decided that the user (in environments where there is a user) should be able to interrupt a PAUSE. That's why it makes a window visible if there isn't a suitable window already visible. This may not have been the best design but we are loath to change such long-existing behaviors because we have historically been bitten in the ass when we do.

This thread is closed