Expression Functions
Expressions support the use of a set of functions. These functions cannot be used outwith expressions as per general functions (unless used as an array argument). However, expressions can also contain general and item functions. Expression functions do not require % symbols to define them.
The supported list of Expression Functions is as follows:
Abs
This returns the absolute value (positive part) of a number
Syntax
Parameters
val |
An expression that resolves to a number (integer). |
Example
This randomly returns one of the two input parameters. The function works on both numbers, and text values. This function is basically the same as the ONEOF function, but can only take two parameters.
Syntax
Parameters
val1 |
An expression that resolves to a number (integer) or text (string). |
val2 |
An expression that resolves to a number (integer) or text (string). |
Example
Instr
This function returns an integer specifying the start position of the first occurrence of one string within another.
Syntax
Parameters
str1 |
An expression that resolves to text (string). This is the string being searched. |
str2 |
An expression that resolves to text (string). This is the string expression sought. |
Example
Note that this is not case sensitive, so INSTR("hello","E") will also return 2.
This function returns 0 (zero) if str2 does not exist within str1.
This function evaluates the first parameter. If this evaluates to True it returns the second parameter. If not, it returns the third parameter.
Syntax
Parameters
Test |
An expression that resolves to True or False The test conditions supported are <, <=, =, >=, >, and <>. Test conditions can be ANDed and ORed together using AND and OR |
TruePart |
An expression that resolves to a number (integer) or text (string). Returned if Test evaluates to True. |
FalsePart |
An expression that resolves to a number (integer) or text (string). Returned if Test evaluates to False. |
Examples
LCase
This returns a text value in Lower Case.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Left
This returns the requested number of characters from a piece of text, starting from the left.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Len
This returns the length of a piece of text.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Max
This returns the maximum of two numbers.
Syntax
Parameters
val1 |
An expression that resolves to a number (integer). |
val2 |
An expression that resolves to a number (integer). |
Example
Mid
This returns the requested number of characters from a piece of text, starting at the specified location.
Syntax
Parameters
str |
An expression that resolves to text (string). |
start |
An expression that resolves to a number (integer) for the start position in the text. This parameter is 0 indexed, i.e. to return characters starting from the second character you would supply the value 1. |
length |
An expression that resolves to a number (integer) for the number of characters to be returned. |
Example
Min
This returns the minimum of two numbers.
Syntax
Parameters
val1 |
An expression that resolves to a number (integer). |
val2 |
An expression that resolves to a number (integer). |
Example
This randomly returns one of the supplied input parameters. The function works on both numbers, and text values. Any number of parameters can be supplied. This function is basically the same as the EITHER function, but can take more parameters.
Syntax
Parameters
val1 |
An expression that resolves to a number (integer) or text (string). |
val2 |
An expression that resolves to a number (integer) or text (string). |
val3 |
An expression that resolves to a number (integer) or text (string). |
Example
PCase
This returns a text value in Proper (i.e. first letter capitalised, the rest lower) Case.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Rand
This returns a random number between two supplied values.
Syntax
Parameters
val1 |
An expression that resolves to a number (integer). |
val2 |
An expression that resolves to a number (integer). |
Example
Replace
This function replaces all instances of a piece of text with another, inside another piece of text.
Syntax
Parameters
Source |
An expression that resolves to text (string). This will be returned by the function, with all instances of Find replaced to Replace. |
Find |
An expression that resolves to text (string). This is the text to search for. |
Replace |
An expression that resolves to text (string). This is the text to replace any found text. |
Example
Right
This returns the requested number of characters from a piece of text, starting from the right.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Str
This converts a number to text.
Syntax
Parameters
val |
An expression that resolves to a number (integer). |
Example
UCase
This returns a text value in Upper Case.
Syntax
Parameters
str |
An expression that resolves to text (string). |
Example
Val
This converts text to a number. If the text does not represent a number, zero will be returned.
Syntax
Parameters
str |
An expression that resolves to a number (integer) or text (string). |
Example