m
no edit summary
mNo edit summary |
mNo edit summary |
||
| Line 5: | Line 5: | ||
Executes 'statements' for each value of 'variable' from 'lowvalue' to 'highvalue', at a step value of 'step' inclusive. Other syntax options yet unknown. | Executes 'statements' for each value of 'variable' from 'lowvalue' to 'highvalue', at a step value of 'step' inclusive. Other syntax options yet unknown. | ||
for [key],[value] in [table] do [statements] end | for [key],[value] in pairs([table]) do [statements] end | ||
Executes 'statements' for each element of the 'table'. 'key' contains element key (index), 'value' contains element value. | Executes 'statements' for each element of the 'table'. 'key' contains element key (index), 'value' contains element value. | ||
| Line 31: | Line 31: | ||
/script myTable = {"a","b","c","d"}; | /script myTable = {"a","b","c","d"}; | ||
for k,v in myTable do | for k,v in pairs(myTable) do | ||
DEFAULT_CHAT_FRAME:AddMessage("The value of index "..k.." is "..v); | DEFAULT_CHAT_FRAME:AddMessage("The value of index "..k.." is "..v); | ||
end; | end; | ||