This works too:

try
    while true
    end
catch x
    if isa(x, InterruptException)
        return array
    end
end

On Tuesday, November 10, 2015 at 8:23:47 AM UTC-5, Felipe Jiménez wrote:
>
> Thank you, Palli and Cedri.
>
> Palli's answer shows it's not as easy as I thought. Cedric's answer is 
> practical without overkill, so I'll go that way by now.
>
> Still if someone writes a Julia readchar() or readkey() function that is 
> similar to readline() but does not wait for Enter to be pressed, I am sure 
> many people will find it useful!
>

Reply via email to