Audio alarm: Difference between revisions

→‎{{header|REXX}}: added the REXX language. -- ~~~~
(→‎Tcl: Added implementation)
(→‎{{header|REXX}}: added the REXX language. -- ~~~~)
Line 33:
 
end</lang>
 
=={{header|REXX}}==
===using SLEEP===
<lang rexx>/*REXX pgm to prompt user for: # (of secs); a name of a MP3 file to play*/
 
say '──────── Please enter a number of seconds to wait:'
parse pull waitTime .
/*add code to verify number is a valid number. */
 
say '──────── Please enter a name of an MP3 file to play:'
parse pull MP3FILE
/*add code to verify answer is a valid filename.*/
 
call sleep waitTime
MP3FILE'.MP3'
/*stick a fork in it, we're done.*/</lang>
'''output''' when using the input of: <tt> xxx </tt>
 
===using spin===
<lang rexx>/*REXX pgm to prompt user for: # (of secs); a name of a MP3 file to play*/
 
say '──────── Please enter a number of seconds to wait:'
parse pull waitTime .
 
say '──────── Please enter a name of an MP3 file to play:'
parse pull MP3FILE
 
call time 'Reset' /*reset the REXX (elapsed) timer.*/
 
do until time('E') >waitTime /*wait out the clock (in seconds)*/
end
 
MP3FILE'.MP3'
/*stick a fork in it, we're done.*/</lang?
 
=={{header|Tcl}}==