The [Case] tag is used to define one possible outcome from [Select] ... [/Select] tags. If the value specified in the opening [Select] tag matches the value for the [Case] tag then the code until the next [Case] tag is executed.
If a [Case] tag is specified without a value then it is the default case and will be executed only if no other [Case] in the current [Select] ... [/Select] tags is matched.
[Select: 'Select Value']
[Case: 'Case 1 Value']
... Case 1 Code ...
[Case: 'Case 2 Value']
... Case 2 Code ...
[Case]
... Default Code ...
[/Select]
Use the [Select] ... [Case] ... [/Select] tags. The opening [Select] tag accepts a variable that contains a value. The code which is after the first enclosed [Case] statement which matches the variable's value is executed. In the example below a 'color' variable is matched against several color names. If there is no match a default of black or #000000 is used.
[Variable: 'color'='green']
[Select: $color]
[Case: 'red']
[Output: '#ff0000']
[Case: 'green']
[Output: '#00ff00']
[Case: 'blue']
[Output: '#0000ff']
[Case]
[Output: '#000000']
[/Select]
#00ff00
Use the [Select] ... [Case] ... [/Select] tags. The opening [Select] tag accepts a variable that contains a value. The code which is after the first enclosed [Case] statement which matches the variable's value is executed. In the example below a 'color' variable is matched against several color names. If there is no match a default of black or #000000 is used.
#0000ff
Tag Link | [Case] | Category | Conditional |
---|---|---|---|
Type | Process | Data Source | Any |
Support | Preferred | Version | 6.0 |
Output Type | None | Security | Tag |
Implementation | Internal | Sets | Lasso 7.0, Lasso 6.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft