arc:select keyword is similar to a switch-case block in other programming languages and can be used to create complex conditional statements. The body of arc:select can contain one or more arc:case keywords and one arc:default keyword.
The value in arc:select is matched with those specified in arc:case. The body of the arc:case statement contains the keywords and statements to execute if the value specified matches the value in the arc:select keyword.
The body of the arc:default statement is only executed if none of the arc:case statements result in a match. The arc:default keyword has no parameters and can appear only once in an arc:select.
Parameters
- value: The value to compare with those specified in
arc:casestatements. - attr: The attribute whose value is compared with values specified in
arc:casestatements.
Control Attributes
NoneExample
Set the icon based on the company name. The arc:case elements matchCompanyA and CompanyB in the company_name attribute. If any occurrences are found, take the action associated with that case.
See Also
- arc:case: Write cases for
arc:select. - arc:default: Write a default case for
arc:select.