This shows you the differences between two versions of the page.
en:public:developer:template_system:tags:expression:caseof [2012/11/19 11:25] admin [Attributes] |
en:public:developer:template_system:tags:expression:caseof [2012/11/19 11:51] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== <#CaseOf> ===== | + | ====== <#CaseOf> ====== |
The purpose of the CaseOf is to allow the value of a variable or expression to control the flow of program execution via a multiway branch. The main reasons for using a CaseOf include improving clarity, by reducing otherwise repetitive coding | The purpose of the CaseOf is to allow the value of a variable or expression to control the flow of program execution via a multiway branch. The main reasons for using a CaseOf include improving clarity, by reducing otherwise repetitive coding | ||
Line 6: | Line 6: | ||
^ Name ^ Mandatory ^ Description ^ | ^ Name ^ Mandatory ^ Description ^ | ||
- | | **expression** | Yes | An arbitrary expression (string or number) | | + | | <html><span style="color:#008000">Expression</span></html> | Yes | An arbitrary expression (string or number). The tags in the expression are always evaluated first | |
- | | **statement_<a>** | No | The content (html text or template filename) to return if the expression evaluate to <a> | | + | | <html><span style="color:#008000">Statement_<a></span></html> | No | The content (html text or template filename) to return if the expression evaluate to <a> | |
- | | ... | ... | ... | | + | | <html><span style="color:#008000">...</span></html> | ... | ... | |
- | | **statement_<n>** | No | The content (html text or template filename) to return if the expression evaluate to <n> | | + | | <html><span style="color:#008000">Statement_<n></span></html> | No | The content (html text or template filename) to return if the expression evaluate to <n> | |
- | | **Default** | No | Default value to return if no result found (else raise an error) | | + | | <html><span style="color:#008000">Default</span></html> | No | Default value to return if no result found (else raise an error) | |
==== Example ==== | ==== Example ==== | ||