Other expressions
Last updated
Was this helpful?
Last updated
Was this helpful?
A case expression selects one of several values based on some condition. A case expression consists of at least one case clause and exactly one default case beginning with the else
keyword.
FlowScript comes with a number of , and you can .
Sometimes it is useful to create en "empty" value of some type. You can use the default keyword for this.
The error expression (which doubles as a statement) stops the execution of the application and displays an error message to the user.
The like operator is used for simple, SQL-like matching of text values.
The value on the right side is referred to as the "pattern".
Wildcards are used to substitute any number of characters in text comparison.
%
: Matches any sequence of characters, including zero characters.
'sweden' like 'swe%'
matches because anything can follow "swe".
'austria' like '%ia'
matches because the string ends with "ia".
_
: Matches exactly one character.
'luxembourg' like 'l_xembour_'
matches because "u" and "g" are the single characters in those positions.
Character sets allow you to specify a set of characters, any of which can match a character in the specified position.
[...]
: Matches any single character within the brackets.
'myanmar' like 'my[a-z]nmar'
matches because "a" falls within the range "a" to "z".
'USA' like 'US[AB]'
matches because "A" is in the set "A, B".
[character-character]
: Specifies a range of characters.
'myanmar' like 'my[a-z]nmar'
uses a range to specify any letter from "a" to "z".
You can negate a character set by using ^
as the first character after the opening bracket.
[^...]
: Matches any single character not within the brackets.
'ukraine' like '[^b]kraine'
matches because the first character is not "b".
The pattern matching is case insensitive.
'poland' like 'POLAND'
is a match despite differing case.
The in operator denotes a boolean value indicating whether the left hand side is contained in the right hand side.