#424 use of TIME function in ---do while--- loop.

open
nobody
None
5
2014-03-04
2014-03-04
No

In Regina versions 3.2 --> 3.7,
the following program loops forever (in the DO WHILE):

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/REXX/ ld=5 7 9 0 2
wait_for_event: do forever
x=right(time(),1)
if pos(x,ld)\==0 then signal happening
end
exit
happening: say 'event occurred at' time()", the event is:" x
do while x==right(time(),1); end
signal wait_for_event
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

The following fixes the looping problem:

                   do  while  x==right(time(),1); nop;  end

_____ Gerard Schildberger

Discussion

  • Note: the following won't fix the problem:

                       do  while  x==right(time(),1);;  end
    

    _______ Gerard Schildberger