WHILE Loop

A While loop performs a test at the beginning of every loop.

m = 0
while m < 5 do
print("While loop count " .. m)
m = m + 1 -- there is no m++ or m += 1
end