1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
args = {} args['alt1'] = 'foo' args['alt2'] = 'bar' args['alt3'] = 'baz' args['alt4'] = 'qux' args['alt5'] = 'quux' for i = 1, 9 do altX = args['alt'..i] if altX == nil then break end if altX == 'qux' then print(altX) break end end
1
qux