Lua em pares

Exemplos de código

4
0

lua em pares

--Table is the table to iterate through
--Index is the current index
--Value is the value at the current index

for index, value in pairs(table) do

end
2
0

for i in pairs lua

local table =  {2,3,12, "Hello"} --a simple array
for i, item in pairs(table) do -- for i in pairs loop goes through all the items in an array/table
	print(item)
end

Páginas relacionadas

Páginas semelhantes com exemplos

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................