March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
16
Task/Events/REXX/events.rexx
Normal file
16
Task/Events/REXX/events.rexx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*REXX program shows a method of handling events (this is time-driven). */
|
||||
signal on halt /*allow the user to HALT the pgm.*/
|
||||
parse arg timeEvent /*allow "event" to be specified. */
|
||||
if timeEvent='' then timeEvent=5 /*if not specified, use default. */
|
||||
|
||||
event?: do forever /*determine if an event occurred.*/
|
||||
theEvent=right(time(),1) /*maybe it's an event, maybe not.*/
|
||||
if pos(theEvent,timeEvent)\==0 then signal happening
|
||||
end /*forever*/
|
||||
|
||||
say 'Control should never get here!' /*This is a logic no-no occurance*/
|
||||
halt: say 'program halted.'; exit /*stick a fork in it, we're done.*/
|
||||
/*───────────────────────────────────HAPPENING processing───────────────*/
|
||||
happening: say 'an event occurred at' time()", the event is:" theEvent
|
||||
do while theEvent==right(time(),1); /*process the event here.*/ nop;end
|
||||
signal event? /*see if another event happened. */
|
||||
Loading…
Add table
Add a link
Reference in a new issue