lua-users home
lua-l archive

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


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