[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: how io.read() will return nil ?
- From: lee <leeyacn@...>
- Date: Sun, 24 Aug 2008 18:19:15 +0800
hi, list
I am a newbie to Lua and learning.
I write a test script, named test3.lua:
for count = 1, math.huge do
local line = io.read()
if line == nil then break end
io.write(string.format("%6d ", count), line, "\n")
end
The script is very simple, but after running it, I do not know how to exit
the script normally.
I means what I should input will make io.read() return nil.
thanks all.
--
As we know, there are known knowns. There are things we know we know. We
also know there are known unknowns. That is to say we know there are some
things we do not know. But there are also unknown unknowns, the ones we
don't know we don't know.