REBOL: How to do another task while waiting an alarm to trigger ?

Posted by Rebol Tutorial on Stack Overflow See other posts from Stack Overflow or by Rebol Tutorial
Published on 2010-04-25T14:13:45Z Indexed on 2010/04/25 14:23 UTC
Read the original article Hit count: 217

Filed under:

So I have created an alarm function:

alarm: func[seconds message [string! unset!]][
     wav: load %attention.wav
     sound-port: open sound://
     wait seconds do [
     insert sound-port wav
     wait sound-port
     close sound-port
     if (value? 'message) [
           print message
        ]
   ]
]

which works like this:

alarm 30 "Will trigger in 30 seconds"

Now how can I for example show a timer which increments while waiting for the alarm since Rebol doesn't support thread ?

© Stack Overflow or respective owner

Related posts about rebol