lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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