How do you use a Select Case like in JavaScript?

Source: Internet
Author: User
Switch statement &nbsp;&nbsp; Language Reference <br>
<br>
<br>
Description <br>
When the value of the specified expression matches a label, the corresponding one or more statements are executed. <br>
Grammar <br>
switch (expression) {<br>
&nbsp;&nbsp;&nbsp;case label:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statementlist<br>
&nbsp;&nbsp;&nbsp;case label:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statementlist<br>
&nbsp;&nbsp;&nbsp;...<br>
&nbsp;&nbsp;&nbsp;default:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statementlist<br>
} <br>
The syntax of the switch statement consists of the following: <br>
<br>
Part &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description <br>
expression&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An expression for the &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; requirement value.
<br>
label&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; according to expression to match the identifier. If the label = = = Expression, the execution begins immediately after the colon statementlist until an optional break statement is encountered, or the end of the switch statement is reached.
<br>
Statementlist one or more statements to be executed.
<br>
<br>
<br>
Description <br>
Use the default clause to provide a statement that is executed only if none of the tag values match the expression. It can appear anywhere within the switch code block.
<br>
You can specify 0 or more label blocks. If there is no matching value for the label and expression, and no default is provided, no statements are executed. <br>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.