[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: table reset
- From: Markus Huber <pulse@...>
- Date: Sat, 10 Jul 2004 18:44:21 +0200 (BST)
-- Wich version is better and why? Any suggestions are welcome.
local Lines={}
while true do
local Line=Handle:read('*line')
if Line==nil then break end
if Line~='' then
table.insert(Lines,Line)
else
-- process lines here; e.g. with iterator
Lines={}
end
end
while true do
local Lines=Lines or {}
local Line=Handle:read('*line')
if Line==nil then break end
if Line~='' then
table.insert(Lines,Line)
else
-- process lines here; e.g. with iterator
Lines=nil
end
end
-- The job is to read all lines until an empty line and
-- then process these lines and then read the next block
-- of lines until an empty line and so on...
-- Markus