[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: io.read("*n") doesn't read after number parsing error
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 28 Feb 2015 22:30:39 +0200
2015-02-28 21:44 GMT+02:00 Nagaev Boris <bnagaev@gmail.com>:
>
> Is this true, that io.read("*n") should be used if only input is
> guaranteed to be a number?
Not at all. You can use it to find out whether the input starts with
a number. You should always test the return value. If nil, you
can re-read the input with a more forgiving format.