TimeOut for procedure

vkv1389

New Member
I need to set timeout for procedure running.
For example :
I am running a procedure which is taking 5 sec. I should stop the procedure if it takes more than 2 seconds. Please help me on this.
 
Your description is a little bit vague ...

Basically you need to roll your own logic to code the time out. As the AVM is not multi-threaded you can't have a time keeper and your processing logic in parallel. You _COULD_ do something like this ( where the glWaitForResult logical would be set to true in some trigger that responds to an OCX event for example ). If the logical is not set at the end of the wait you know that your logic didn't complete.

Code:
&SCOPED-DEFINE TIME-OUT 2

ETIME ( TRUE ).

/* Wait on the result or the time out after seconds ... */
DO WHILE glWaitForResult AND ETIME / 1000 < {&TIME-OUT}:
    PROCESS EVENTS.
END.
 
I think this is a question about the STOP-AFTER phrase in the DO statement.
I can only refer to Progress documentation about it.
 
AFAIK, STOP-AFTER has been introduced with OE11 and is not available in previous releases. But since the OP did not say anything about what versions we are talking ...

Heavy Regards, RealHeavyDude.
 
Back
Top