[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Why does this exit the function early?
- From: Paul Butler <butler.paul@...>
- Date: Thu, 18 Jun 2009 10:08:24 -0700
Newbie question.....
Why does the "break" end the function?
I was expecting it to count to 10 and just skip over 5.
function doThis()
local count = 0
while true do
count = count + 1
if count == 5 then break end
print(count)
if count == 10 then return end
end
print("why are we here?")
end
doThis()
--
-paul