Skip to content

Array Functions

Before going in note that any time VARNAME or FUNCNAME is written, it means a variable or function in the form Collection@Variable or a literal.

min

Syntax:

VARNAME1 = min(VARNAME2)
Returns the minimum value in VARNAME2 and assigns it to VARNAME1. VARNAME2 must be an array of numbers.

max

Syntax:

VARNAME1 = max(VARNAME2)
Returns the maximum value in VARNAME2 and assigns it to VARNAME1. VARNAME2 must be an array of numbers.

rfind

Syntax:

VARNAME1 = rfind(VARNAME2, VARNAME3)

Finds the first string in the array VARNAME2 that matches the regex pattern VARNAME3 and assigns it to VARNAME1. If no match is found, VARNAME1 is assigned an empty string. VARNAME2 must be an array of strings, and VARNAME3 must be a string representing a regex pattern.

rfindindex

Syntax:

VARNAME1 = rfindindex(VARNAME2, VARNAME3)

Finds the index of the first string in the array VARNAME2 that matches the regex pattern VARNAME3 and assigns it to VARNAME1. If no match is found, -1.0 is returned. VARNAME2 must be an array of strings, and VARNAME3 must be a string representing a regex pattern.

find

Syntax:

VARNAME1 = find(VARNAME2, VARNAME3)

Finds the index of the first string with the content VARNAME3 in the array VARNAME2 and assigns the result to VARNAME1. If no match is found an error is thrown. VARNAME2 must be an array of any type, and VARNAME3 must match that type.

get

Syntax:

VARNAME1 = get(VARNAME2, VARNAME3)

Gets the value at index VARNAME3 in the array VARNAME2 and assigns it to VARNAME1. If VARNAME3 is out of bounds, an error is thrown. VARNAME2 must be an array of any type, and VARNAME3 must be a number representing a valid index in VARNAME2.

length

Syntax:

VARNAME1 = len(VARNAME2)

Returns the length of the array VARNAME2 and assigns it to VARNAME1. VARNAME2 must be an array of any type.

append

Syntax:

VARNAME1 = append(VARNAME2, VARNAME3)

Clones the array VARNAME2 but with the value VARNAME3 added to the end and assigns it to VARNAME1. VARNAME2 must be an array of any type, and VARNAME3 must match that type.