﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="thpdoc.xsl"?>
<page id="switch" suffix=" Statement">
  <subsection>Equivalent to the case statement in VHDL.<code>switch (Expression)
{
	case Val1:
	case Val2:
		...
		break;
	case Val3:
		...
		break;
	case ValN:
		...
		break;
	default:
		...
		break;
}</code>
	<p>The <kw>switch</kw> statement can be specified inside a process or function. It uses C++ syntax and will be directly converted to a VHDL case statement.</p>
</subsection>
<section name="Remarks">
	<p>If the expression used in the <kw>switch</kw> statement is of an enumeration type and you want to ensure that all cases have been considered, use the <kw>switchall</kw> statement.</p>
</section>
<section name="Examples">
	<p>See <kw>enum</kw> page for examples</p>
</section>
  <seealso id="process"/>
  <seealso id="functions"/>
  <seealso id="switchall"/>
  <seealso id="select"/>
  <seealso id="selectall"/>
</page>