<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://fenixdocs.com/skins/common/feed.css?63"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://fenixdocs.com/index.php?action=history&amp;feed=atom&amp;title=Switch</id>
		<title>Switch - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://fenixdocs.com/index.php?action=history&amp;feed=atom&amp;title=Switch"/>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;action=history"/>
		<updated>2026-05-01T08:54:44Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.10.1</generator>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4719&amp;oldid=prev</id>
		<title>Sandman: /* Example */</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4719&amp;oldid=prev"/>
				<updated>2008-07-16T12:58:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 12:58, 16 July 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 42:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 42:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Example ==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Example ==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;A scoretext function. Notice the '''default''': when the points can be 0..100, that code should never be executed. However, an error can occur and blurting an error to the user is not that fancy, so this is a way of showing to the programmer there is an error, but still the user gets some message. In such cases, '''default''' can be handy. Of course that code could just as easily have been put under the '''switch''' with the same result.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;A scoretext function. Notice the '''default''': when the points can be 0..100, that code should never be executed. However, an error can occur and blurting an error to the user is not that fancy, so this is a way of showing to the programmer there is an error, but still the user gets some message. In such cases, '''default''' can be handy. Of course that code could just as easily have been put under the '''switch''' with the same result&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, in this case, because every case does a [[return]]&lt;/ins&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4718&amp;oldid=prev</id>
		<title>Sandman: /* Definition */</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4718&amp;oldid=prev"/>
				<updated>2008-07-16T12:43:41Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Definition&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 12:43, 16 July 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 13:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 13:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;:['''Default&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''''''&lt;/del&gt;:'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;:['''Default:'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4717&amp;oldid=prev</id>
		<title>Sandman: /* Definition */</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4717&amp;oldid=prev"/>
				<updated>2008-07-16T12:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Definition&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 12:43, 16 July 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 15:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 15:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:['''Default'''''':'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:['''Default'''''':'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;:'''End'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;:'''End'''&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;'''End'''&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;'''End'''&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4716&amp;oldid=prev</id>
		<title>Sandman at 12:42, 16 July 2008</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4716&amp;oldid=prev"/>
				<updated>2008-07-16T12:42:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 12:42, 16 July 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 10:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 10:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;'''Switch''' ( &amp;lt;value&amp;gt; )&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;'''Switch''' ( &amp;lt;value&amp;gt; )&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;:['''Case''' &amp;lt;value&amp;gt;:&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;:['''Case''' &amp;lt;value&amp;gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'''&lt;/ins&gt;:&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'''&lt;/ins&gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End''']&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;:['''Default''':&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;:['''Default&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'''&lt;/ins&gt;''':&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'''&lt;/ins&gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;:'''End'''&amp;lt;br&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 34:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 34:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;When the '''switch''' is reached it will compare ''value'' with &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;all &lt;/del&gt;the values in the '''case'''s. When &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;one compares&lt;/del&gt;, that code is executed and the '''switch''' is exited. This is different than the '''switch''' in C and probably more languages, because there the '''switch''' is only exited when a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'''&lt;/del&gt;break&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''' &lt;/del&gt;is reached or when the '''switch''' ends.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;When the '''switch''' is reached it will compare ''value'' with the values in the '''case'''s&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, going from top to bottom&lt;/ins&gt;. When &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a case matches&lt;/ins&gt;, that code is executed and the '''switch''' is exited. This is different than the '''switch''' in C and probably more languages, because there the '''switch''' is only exited when a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;break&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/ins&gt;is reached or when the '''switch''' ends&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. In Fenix there is no break; for the switch, though&lt;/ins&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;A value in a '''case''' can also be a range: &amp;lt;code&amp;gt;&amp;lt;lowervalue&amp;gt;..&amp;lt;uppervalue&amp;gt;&amp;lt;/code&amp;gt;. Both the ''lowervalue'' and the ''uppervalue'' are part of the range.&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;A value in a '''case''' can also be a range: &amp;lt;code&amp;gt;&amp;lt;lowervalue&amp;gt;..&amp;lt;uppervalue&amp;gt;&amp;lt;/code&amp;gt;. Both the ''lowervalue'' and the ''uppervalue'' are part of the range.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4689&amp;oldid=prev</id>
		<title>85.144.194.29: /* Example */</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4689&amp;oldid=prev"/>
				<updated>2008-06-04T16:02:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 16:02, 4 June 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 59:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 59:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        End&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        End&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        Case 60..80:&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        Case 60..80:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;            return &amp;quot;Not &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to &lt;/del&gt;shabby, mate.&amp;quot;;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;            return &amp;quot;Not &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;too &lt;/ins&gt;shabby, mate.&amp;quot;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        End&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        End&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        Case 50..60:&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;        Case 50..60:&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>85.144.194.29</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=4345&amp;oldid=prev</id>
		<title>Sandman at 14:24, 20 February 2008</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=4345&amp;oldid=prev"/>
				<updated>2008-02-20T14:24:12Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 14:24, 20 February 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 36:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 36:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;When the '''switch''' is reached it will compare ''value'' with all the values in the '''case'''s. When one compares, that code is executed and the '''switch''' is exited. This is different than the '''switch''' in C and probably more languages, because there the '''switch''' is only exited when a '''break''' is reached or when the '''switch''' ends.&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;When the '''switch''' is reached it will compare ''value'' with all the values in the '''case'''s. When one compares, that code is executed and the '''switch''' is exited. This is different than the '''switch''' in C and probably more languages, because there the '''switch''' is only exited when a '''break''' is reached or when the '''switch''' ends.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;A value in a '''case''' can also be a range: &amp;lt;code&amp;gt;&amp;lt;lowervalue&amp;gt;..&amp;lt;uppervalue&amp;gt;&amp;lt;/code&amp;gt;. Both the lowervalue and the uppervalue are part of the range.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;A value in a '''case''' can also be a range: &amp;lt;code&amp;gt;&amp;lt;lowervalue&amp;gt;..&amp;lt;uppervalue&amp;gt;&amp;lt;/code&amp;gt;. Both the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;lowervalue&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/ins&gt;and the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;uppervalue&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/ins&gt;are part of the range&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You can also specify multiple values in a '''case''', separated by a comma: &amp;lt;code&amp;gt;&amp;lt;value1&amp;gt;,&amp;lt;value2&amp;gt;,...&amp;lt;code&amp;gt;. These values can also be ranges&lt;/ins&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Example ==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Example ==&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	<entry>
		<id>http://fenixdocs.com/index.php?title=Switch&amp;diff=3661&amp;oldid=prev</id>
		<title>Sandman: New page: category:reserved category:language category:control flow statements  '''Up to Control Flow Statements''' ----   == Definition ==  '''Switch''' ( &lt;v...</title>
		<link rel="alternate" type="text/html" href="http://fenixdocs.com/index.php?title=Switch&amp;diff=3661&amp;oldid=prev"/>
				<updated>2007-11-09T13:13:48Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/index.php/Category:Reserved&quot; title=&quot;Category:Reserved&quot;&gt;category:reserved&lt;/a&gt; &lt;a href=&quot;/index.php/Category:Language&quot; title=&quot;Category:Language&quot;&gt;category:language&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:Control_flow_statements&amp;amp;action=edit&quot; class=&quot;new&quot; title=&quot;Category:Control flow statements&quot;&gt;category:control flow statements&lt;/a&gt;  &lt;a href=&quot;/index.php/Control_flow_statements&quot; title=&quot;Control flow statements&quot;&gt;'''Up to Control Flow Statements'''&lt;/a&gt; ----   == Definition ==  '''Switch''' ( &amp;lt;v...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[category:reserved]]&lt;br /&gt;
[[category:language]]&lt;br /&gt;
[[category:control flow statements]]&lt;br /&gt;
&lt;br /&gt;
[[Control flow statements|'''Up to Control Flow Statements''']]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Definition ==&lt;br /&gt;
&lt;br /&gt;
'''Switch''' ( &amp;lt;value&amp;gt; )&amp;lt;br&amp;gt;&lt;br /&gt;
:['''Case''' &amp;lt;value&amp;gt;:&amp;lt;br&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:'''End''']&amp;lt;br&amp;gt;&lt;br /&gt;
:['''Default''':&amp;lt;br&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:'''End'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''End'''&lt;br /&gt;
&lt;br /&gt;
A ''Switch'' is used to control the flow of a program by means of comparing a value to other values and executing the code associated with the correct value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
switch ( &amp;lt;value&amp;gt; )&lt;br /&gt;
    case &amp;lt;value1&amp;gt;:&lt;br /&gt;
        // code1&lt;br /&gt;
    end&lt;br /&gt;
    case &amp;lt;value2&amp;gt;:&lt;br /&gt;
        // code2&lt;br /&gt;
    end&lt;br /&gt;
    default:&lt;br /&gt;
        // code3&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the '''switch''' is reached it will compare ''value'' with all the values in the '''case'''s. When one compares, that code is executed and the '''switch''' is exited. This is different than the '''switch''' in C and probably more languages, because there the '''switch''' is only exited when a '''break''' is reached or when the '''switch''' ends.&lt;br /&gt;
&lt;br /&gt;
A value in a '''case''' can also be a range: &amp;lt;code&amp;gt;&amp;lt;lowervalue&amp;gt;..&amp;lt;uppervalue&amp;gt;&amp;lt;/code&amp;gt;. Both the lowervalue and the uppervalue are part of the range.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
A scoretext function. Notice the '''default''': when the points can be 0..100, that code should never be executed. However, an error can occur and blurting an error to the user is not that fancy, so this is a way of showing to the programmer there is an error, but still the user gets some message. In such cases, '''default''' can be handy. Of course that code could just as easily have been put under the '''switch''' with the same result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Function String scoretext( int points )&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
    Switch( points )&lt;br /&gt;
        Case 100:&lt;br /&gt;
            return &amp;quot;1337 |-|4&amp;gt;&amp;lt;0|2!!1&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 90..100:&lt;br /&gt;
            return &amp;quot;Awesomely cool, dude!&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 80..90:&lt;br /&gt;
            return &amp;quot;You're getting the hang of it!&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 60..80:&lt;br /&gt;
            return &amp;quot;Not to shabby, mate.&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 50..60:&lt;br /&gt;
            return &amp;quot;Practice some more.&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 30..50:&lt;br /&gt;
            return &amp;quot;Dude...weak.&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 1..30:&lt;br /&gt;
            return &amp;quot;That's just awful&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Case 0:&lt;br /&gt;
            return &amp;quot;No points? n00b!&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
        Default:&lt;br /&gt;
            return &amp;quot;I dunno what you did, but...&amp;quot;;&lt;br /&gt;
        End&lt;br /&gt;
    End&lt;br /&gt;
&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandman</name></author>	</entry>

	</feed>