<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Conditional (computer programming) - Page 4 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Conditional_(computer_programming)&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Conditional_%28computer_programming%29&amp;p=5">3.Next</a>
</p>
<p>of statements.</p>

<p><syntaxhighlight lang="lua">if condition then    consequentelse    alternativeend if</syntaxhighlight></p>

<p>The following example, also in pseudocode, replaces placeholders with example logic.</p>

<p><syntaxhighlight lang="lua">if stock = 0 then    message = 'order new stock'else    message = 'there is stock'end if</syntaxhighlight></p>

<p><big>History and development</big></p>
<p>In early programming languages, especially dialects of <a href="page.php?w=BASIC">BASIC</a>, an if-then-else statement could only contain <a href="page.php?w=goto">goto</a></p><p>
<a accesskey="1" href="page.php?w=Conditional_(computer_programming)&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Conditional_%28computer_programming%29&amp;p=5">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
