| Syntax |
|
| Documentation | Conditionally perform statements based on an expression:
default_action, the action to be performed if none of value_1 through value_n equals value. value_1 through value_n, the values to be compared with value for equality (must be unique). value_1_action through value_n_action, the apropriate action to be performed in case value equals to value_1 or value_2 ... or value_n. |
| Examples | |
Example 1:
$switch{$get{color}} {you have selected a color without suitable action} {red} {you have selected red} {blue} {you have selected blue} {yellow} {you have selected yellow} Result 1: if the value of the current Variable "color" is "red": you selected red if the value of the current Variable "color" is "blue": you selected blue if the value of the current Variable "color" is "yellow": you selected yellow if the value of the current Variable "color" is not "red", "blue" or "yellow": you selected a color without suitable action
$switch{$getCurrent{action}}{} {forward} { Forwardparameter <Form ACTION="sfs" method="post" name="Formular"> <INPUT TYPE=HIDDEN NAME=t VALUE="onMailbox_created"> <INPUT TYPE=HIDDEN NAME=i VALUE="$getCurrent{i}"> <INPUT TYPE=HIDDEN NAME=u VALUE="$getCurrent{u}"> <INPUT TYPE=HIDDEN NAME=p VALUE="$getCurrent{p}"> <INPUT TYPE=HIDDEN NAME=action VALUE="$getCurrent{action}"> eMail address: <input type=text name="address" size="30" maxlength="10"><br><br> <input type=submit> } {reply} {$include{reply_template}} {delete} {$include{delete_template}} Result 2: if current action is "forward": execute forward action if current action is "reply": includes and executes "reply_template" if current action is "delete": includes and executes "delete_template" |
|
| Group | Control_Flow |
| Minimum required transaction-mode: | NONE |
| Required scripting permission of the developer | PERMISSION_FL_BASIC |
| Minimum parameters | 2 |
| Maximum parameters | <unlimited> |