Case Element (View)
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Used inside a Switch statement or FieldSwitch statement to perform a comparison.
<Case
Value = "Text">
</Case>
Attributes
Attribute |
Description |
---|---|
Value |
Optional Text. The value to check for in a comparison. |
Child Elements
Numerous |
Parent Elements
Occurrences
Minimum: 0 Maximum: Unbounded |
Remarks
Within a Switch statement, the Case element is often used in conjunction with the Default element. If the criteria set by the Case value proves false, then the default value is implemented.
Example
The following example checks the value of a UserID field and returns "User Zero" if the value is 0 (zero). Otherwise, it sets a default value: "Not User Zero".
<Switch>
<Expr><UserID/></Expr>
<Case Value="0">User Zero</Case>
<Default>Not User Zero</Default>
</Switch>