[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: reading 2 numbers, one following the other
- From: Taj Khattra <taj.khattra@...>
- Date: Wed, 17 Dec 2003 16:33:47 -0800
On Wed, Dec 17, 2003 at 09:03:41PM -0200, Pedro Martelletto wrote:
> works like a charm. i didn't know you could explicitly call tonumber()
> from lua... anyway, auto-conversion should work as well. many thanks.
minor gotcha to beware of if your input fields are not fixed width:
scanf("%3d") with input string 12x will consume only the first 2
bytes, whereas file:read(3) will, of course, consume all 3 (and
therefore tonumber(file:read(3)) will return nil)
-taj