Re: what's wrong with this loop syntax?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: what's wrong with this loop syntax?
- From: Antony Sidwell <antony@...>
- Date: 2007年1月08日 21:37:15 +0000
Michael Newberry wrote:
Luiz, OK, thanks. Is there any way to make it more compact (and more
readable to me, at least), where the loop is tested at the top of the
loop? Here is what I use:
while true do
str = S:Next()
if str == nil then break end
-- [code]
end
I think I generally use something like:
str = S:Next()
while str do
-- [code]
str = S:Next()
end
which is no more compact, but I prefer it anyway, especially for a
simple "next" assignment like that.
--
Antony Sidwell