What is the alternative for switch statement in Lua language?
snippet in lua

What is the alternative for switch statement in Lua language?

user1895

local c_tbl =
{
  [1] = add,
  [2] = save,
}

local func = c_tbl[choice]
if(func) then
  func()
else
  print " The program has been terminated."
  print " Thank you!";
end