<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tw-modding.com/index.php?action=history&amp;feed=atom&amp;title=Lua%3AKeywords</id>
	<title>Lua:Keywords - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tw-modding.com/index.php?action=history&amp;feed=atom&amp;title=Lua%3AKeywords"/>
	<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Lua:Keywords&amp;action=history"/>
	<updated>2026-05-13T23:13:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=412&amp;oldid=prev</id>
		<title>MrIncongruous: Explained what a keyword is</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=412&amp;oldid=prev"/>
		<updated>2021-07-22T06:17:14Z</updated>

		<summary type="html">&lt;p&gt;Explained what a keyword is&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:17, 22 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A keyword is a special word that has been taken for the program, so we can't use it in our own as the name of a variable, function, etc.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We’ve covered the majority of the Lua keywords, but there are a few left that we have to cover. We’ll cover the final keywords that aren’t loop/table-based in this tutorial, and we’ll cover tables and loops in the next! We only have three to touch on.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We’ve covered the majority of the Lua keywords, but there are a few left that we have to cover. We’ll cover the final keywords that aren’t loop/table-based in this tutorial, and we’ll cover tables and loops in the next! We only have three to touch on.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, we’ve seen conditional statements – if these things, then do this. But we haven’t covered their full usage!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, we’ve seen conditional statements – if these things, then do this. But we haven’t covered their full usage!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;thing’s &lt;/del&gt;first – if you want stuff to happen based on a condition, you use that word I just used twice – &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;things &lt;/ins&gt;first – if you want stuff to happen based on a condition, you use that word I just used twice – &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &amp;lt;code&amp;gt;local var = 5&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &amp;lt;code&amp;gt;local var = 5&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff::1.12:old-161:rev-412 --&gt;
&lt;/table&gt;</summary>
		<author><name>MrIncongruous</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=161&amp;oldid=prev</id>
		<title>Vandy at 19:06, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=161&amp;oldid=prev"/>
		<updated>2021-02-07T19:06:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:06, 7 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l118&quot;&gt;Line 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 118:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      out(var) → 5&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      out(var) → 5&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The other, and more common, usage of &amp;lt;code&amp;gt;do&amp;lt;/code&amp;gt; is to attach it to loop keywords. Read on to the next chapter!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The other, and more common, usage of &amp;lt;code&amp;gt;do&amp;lt;/code&amp;gt; is to attach it to loop keywords. Read on to the next chapter!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Lua Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff::1.12:old-151:rev-161 --&gt;
&lt;/table&gt;</summary>
		<author><name>Vandy</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=151&amp;oldid=prev</id>
		<title>Vandy: Created page with &quot;We’ve covered the majority of the Lua keywords, but there are a few left that we have to cover. We’ll cover the final keywords that aren’t loop/table-based in this tutor...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Lua:Keywords&amp;diff=151&amp;oldid=prev"/>
		<updated>2021-02-07T18:42:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;We’ve covered the majority of the Lua keywords, but there are a few left that we have to cover. We’ll cover the final keywords that aren’t loop/table-based in this tutor...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;We’ve covered the majority of the Lua keywords, but there are a few left that we have to cover. We’ll cover the final keywords that aren’t loop/table-based in this tutorial, and we’ll cover tables and loops in the next! We only have three to touch on.&lt;br /&gt;
&lt;br /&gt;
==== If, Elseif, Else ====&lt;br /&gt;
So, we’ve seen conditional statements – if these things, then do this. But we haven’t covered their full usage!&lt;br /&gt;
&lt;br /&gt;
First thing’s first – if you want stuff to happen based on a condition, you use that word I just used twice – &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;.&lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 5&lt;br /&gt;
 &lt;br /&gt;
     if var == 5 then&lt;br /&gt;
         -- &amp;lt;nowiki&amp;gt;[[ do stuff ]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     end&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; defines a new scope here, and that scope ends at, well, &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;. The conditional is the statement between &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt;.&lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 5&lt;br /&gt;
 &lt;br /&gt;
     function example()&lt;br /&gt;
         if var == 5 then -- if var is equivalent to 5 then...&lt;br /&gt;
             out(&amp;quot;This is 5!&amp;quot;)&lt;br /&gt;
             return&lt;br /&gt;
         end&lt;br /&gt;
         out(&amp;quot;Not 5!&amp;quot;)&lt;br /&gt;
     end&lt;br /&gt;
 &lt;br /&gt;
     example() → This is 5!&lt;br /&gt;
 &lt;br /&gt;
     var = 10&lt;br /&gt;
 &lt;br /&gt;
     example() → Not 5!&amp;lt;/code&amp;gt;&lt;br /&gt;
In this example, we’re checking whether var is &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. If it is, we print “This is 5!”; if it isn’t, we print “Not 5!”. We prevent the printing of ''both'' of them by using the &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; – otherwise, if the var were &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;, ''both'' outs would be called.&lt;br /&gt;
&lt;br /&gt;
We can also do this by using the &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; keyword:&lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 5&lt;br /&gt;
 &lt;br /&gt;
     function example()&lt;br /&gt;
         if var == 5 then&lt;br /&gt;
             out(&amp;quot;This is 5!&amp;quot;)&lt;br /&gt;
         else&lt;br /&gt;
             out(&amp;quot;Not 5!&amp;quot;)&lt;br /&gt;
         end&lt;br /&gt;
     end&lt;br /&gt;
 &lt;br /&gt;
     example() → This is 5!&lt;br /&gt;
 &lt;br /&gt;
     var = 10&lt;br /&gt;
 &lt;br /&gt;
     example() → Not 5!&amp;lt;/code&amp;gt;&lt;br /&gt;
Functionally, exactly the same. However, it’s prettier to look at, and makes more sense to read. Do note that &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; also creates its own scope; in this instance, there is a scope between &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;; and another between &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
What if we wanted to check for more than one specific condition? We can use &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt;!&lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 5&lt;br /&gt;
 &lt;br /&gt;
     function example()&lt;br /&gt;
         if var == 5 then&lt;br /&gt;
             out(&amp;quot;This is 5!&amp;quot;)&lt;br /&gt;
         elseif var == 7 then&lt;br /&gt;
             out(&amp;quot;This is 7!&amp;quot;)&lt;br /&gt;
         else&lt;br /&gt;
             out(&amp;quot;Not 5 or 7!&amp;quot;)&lt;br /&gt;
         end&lt;br /&gt;
     end&lt;br /&gt;
 &lt;br /&gt;
     example() → This is 5!&lt;br /&gt;
 &lt;br /&gt;
     var = 7&lt;br /&gt;
 &lt;br /&gt;
     example() → This is 7!&lt;br /&gt;
 &lt;br /&gt;
     var = 10&lt;br /&gt;
 &lt;br /&gt;
     example() → Not 5 or 7!&amp;lt;/code&amp;gt;&lt;br /&gt;
We can use more than one elseif, too. Only one &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; within that block between &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; and the first &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;, though.&lt;br /&gt;
&lt;br /&gt;
Do keep in mind that whichever “path” works first is the one that will be used, and the ones following it will be ignored, until the &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; of the conditional.&lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 10&lt;br /&gt;
 &lt;br /&gt;
     function example()&lt;br /&gt;
         if var &amp;gt; 5 then&lt;br /&gt;
             out(&amp;quot;This is greater than 5!&amp;quot;)&lt;br /&gt;
         elseif var == 5 then&lt;br /&gt;
             out(&amp;quot;This is 5!&amp;quot;)&lt;br /&gt;
         elseif var == 7 then&lt;br /&gt;
             out(&amp;quot;This is 7!&amp;quot;)&lt;br /&gt;
         else&lt;br /&gt;
             out(&amp;quot;Less than 5, not 7!&amp;quot;)&lt;br /&gt;
         end&lt;br /&gt;
     end&lt;br /&gt;
 &lt;br /&gt;
     example() → This is greater than 5!&lt;br /&gt;
 &lt;br /&gt;
     var = 5&lt;br /&gt;
 &lt;br /&gt;
     example() → This is 5!&lt;br /&gt;
 &lt;br /&gt;
     var = 7&lt;br /&gt;
 &lt;br /&gt;
     example() → Less than 5, not 7!&amp;lt;/code&amp;gt;&lt;br /&gt;
Even though the var matches the second conditional statement – &amp;lt;code&amp;gt;var == 7&amp;lt;/code&amp;gt; – for the final assignment, it also matches the first condition, so that’s the one and only path the code takes here.&lt;br /&gt;
&lt;br /&gt;
Do note that you can do just one if and elseif, or an if and an else, or all three, or just an if, or like twenty elseif’s. Though that’s bad code, don’t do that.&lt;br /&gt;
&lt;br /&gt;
==== End, Then, Do ====&lt;br /&gt;
The keyword &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; is needed to denote the end of a scope, when that scope is defined by something other than the entire file. Each of the following keywords need an &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; to finish their scope:&lt;br /&gt;
&lt;br /&gt;
* then&lt;br /&gt;
* do&lt;br /&gt;
* function&lt;br /&gt;
&lt;br /&gt;
And the keyword &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; is needed after the conditional statement for an &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The keyword &amp;lt;code&amp;gt;do&amp;lt;/code&amp;gt; is used in two instances; one, to create a new scope without needing any other keywords (see example below).&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;code&amp;gt;local var = 5&lt;br /&gt;
 &lt;br /&gt;
     do&lt;br /&gt;
         local var = 10&lt;br /&gt;
         out(var) → 10&lt;br /&gt;
     end&lt;br /&gt;
 &lt;br /&gt;
     out(var) → 5&amp;lt;/code&amp;gt;&lt;br /&gt;
The other, and more common, usage of &amp;lt;code&amp;gt;do&amp;lt;/code&amp;gt; is to attach it to loop keywords. Read on to the next chapter!&lt;/div&gt;</summary>
		<author><name>Vandy</name></author>
	</entry>
</feed>