|
Not as clean or flexible as goto, but you can use nested whiles or repeats. YMMV --- function ChooseSetting() return tonumber(arg[1]) end local decision repeat repeat local s = ChooseSetting() if s ~= 3 then break end decision = "red" until true if decision then break end repeat local s = ChooseSetting() if s ~= 2 then break end decision = "yellow" until true if decision then break end repeat local s = ChooseSetting() if s ~= 1 then break end decision = "green" until true until true print(decision or 'none') |