Handle a signal: Difference between revisions

Updated to compile with Nim 1.4.
(Updated to compile with Nim 1.4.)
Line 1,023:
setControlCHook(handler)
 
for n in 1 .. < int64.high:
sleep 500
echo n</lang>
Line 1,029:
<lang nim>import times, os, strutils
 
type EKeyboardInterrupt = object of ExceptionCatchableError
 
proc handler() {.noconv.} =
Line 1,039:
 
try:
for n in 1 .. < int64.high:
sleep 500
echo n
Anonymous user