What is the alternative for switch statement in Lua language?
<p>I have this piece of code in C++ and i want to know how can i write some codes that replace switch statement in Lua because i face many problems and i need to use this statement.</p>

<pre><code>   int choice;
do// loop
{
      cout&lt;&lt;"\n &gt;&gt;&gt; The General Menu &lt;&lt;&lt; \n";
      cout &lt;&lt; endl;
    cout&lt;&lt; " press (1) to Add    "&lt;&lt;endl;
    cout&lt;&lt; " press (2) to Save   "&lt;&lt;endl;
    cout&lt;&lt; " press (3) to Quit " &lt;&lt; endl;
    cout&lt;&lt; endl;
      cout&lt;&lt; "Enter your choice please (1/2/3): ";
    cin&gt;&gt;choice;

    switch(choice)
    {
        case 1: 
            add();
            break;
        case 2:
            save();
            break;

        default:
            cout&lt;&lt;" The program has been terminated "&lt;&lt;endl;
           cout&lt;&lt;" Thank you! \n";          
    }   
} while (choice != 3);
</code></pre>

<p>}
The statement has been used inside a do..while loop.</p>