lua-users home
lua-l archive

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


> >   a = io.read("*n")     -- reads a number ( this works fine )

> I don't know why exactly it doesn't work. Maybe "new line" character
> is consumed not by io.read("*n"), but by io.read(), so the latter
> considers the line to be empty.

Exactly.

One fix is to replace
	a = io.read("*n")
with
	a = io.read("*n","*l")