For loop lua

This article is tagged with: For loop lua and lua

For loop lua

for startValue, EndValue, [increments] do
--code to execute
end
--The increments value is optional. If it isn't defined, it is assumed to be "1"

for loop lua

local t = {}
for index, value in ipairs(t) do
print(index, value)
end

for loop lua

local t = {}
for key, value in pairs(t) do
print(key, value)
end

This article is tagged with: For loop lua and lua