Core library
You can perform basic conditional expressions using if-else and switch alternatives.
String | Description |
---|---|
where:
|
Library function for an If-Else statement. Expressions provided for If and elseIf conditions should evaluate to a boolean value and if not, every attempt will be made to convert the evaluated value to boolean. If the condition evaluates to a Number, any value greater than 0 will be treated as True, or else false. If the condition evaluates to a String, the values The If statement and elseIf statement is a pair: a condition and a value to be used if condition evaluates to true. The elseIf statements are optional, and can enter 0 to 10 elseIf statements as needed. The elseValue to be used if no condition evaluates to true is also optional and is always the last parameter in the method. |
where:
|
Library function for a switch statement. A <valueToFind> is compared against 1 or more choices to match (<choiceToMatch<1…10>>). If a match is found, the value corresponding to the matched choice (<valueToReturn<1…10>>) is returned. If no match is found, <defaultValue> is returned if provided, or else null. <choiceToMatch<n>> and <valueToReturn<n>> are a pair and there should be a minimum of 1 pair and not exceed 10 pairs. A default value can be provided as the last parameter to the method. |
Examples
String | Input |
---|---|
|
returns
returns |
|
returns
returns |