TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Bilow
from: Murray Lesser
date: 1996-04-08 07:25:00
subject: Timing out a REXX progra

Excerpted from message dated 04-06-96, Phil Crown to Mike Bilow:

-=> Quoting Mike Bilow to All <=- 

 MB> I have a situation in which I want to run a REXX script periodically,
 MB> but with the ability to time out if something goes wrong.  For
 MB> example, I have a program (BinkleyTerm) which is started from a batch
 MB> file and which is usually running, but which exits with certain
 MB> errorlevels at scheduled times.  One of these errorlevels causes the
 MB> parent batch file to run a particular REXX script.  Because there are
 MB> certain real-time constraints, I need to be able to limit the amount
 MB> of time that the REXX script runs, killing it ungracefully if
 MB> necessary as a last ditch effort to keep the system running.

PC>How about using a timer in the REXX script itself?

PC>  call time('e') /* start the timer */
PC>  call time('r') /* returns elapsed secs since time('e') */
PC>  if result > MAXTIMEALLOWED then ...

Hi Mike--

    I think Phil mistyped himself .  Time('r') resets the elapsed
timer to zero; time('e') returns the elapsed time since the timer was
reset.  (The first time time('e') is called in any REXX program it
resets the elapsed timer for that program, so time('r') usually isn't
needed.)

    Hope this helps.

          --Murray

___
 * MR/2 2.25 #120 * One printed manual is worth a thousand INF files

--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, Fairfax, VA: 703-385-4325 (1:109/347)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 109/347 18 13/25 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.