Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
37
Task/Sleep/NetRexx/sleep.netrexx
Normal file
37
Task/Sleep/NetRexx/sleep.netrexx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols nobinary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method sleep(secs) public static binary
|
||||
ms = (secs * 1000).format(null, 0) -- milliseconds, rounded to nearest integer
|
||||
say 'Sleeping...'
|
||||
do
|
||||
Thread.sleep(ms)
|
||||
catch ix = InterruptedException
|
||||
say 'Sleep interrupted!'
|
||||
ix.printStackTrace()
|
||||
end
|
||||
say 'Awake!'
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method runSample(arg) public static
|
||||
secs = -1
|
||||
loop until \secs.datatype('N')
|
||||
if secs > 0 then do
|
||||
say 'Napping for' secs's'
|
||||
say
|
||||
sleep(secs)
|
||||
end
|
||||
say
|
||||
say 'How many seconds do you want me to sleep? (enter something non-numeric to terminate)\-'
|
||||
parse ask secs .
|
||||
say
|
||||
end
|
||||
say
|
||||
say 'Goodbye...'
|
||||
say
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue