lst_len(L)

Returns the number of elements in a list-value.

Syntax

lst_len(L)

Input

Argument Type Description
L list-value The name of the list-value whose length will be returned

If L is omitted, an error is returned.

If L is N/A, an error is returned.

A list-value

Return Value

Returns an integer representing the number of elements in L.

Sample Usage

As an example, the following function call:
list="lst(1 2 3 4)"
length="lst_len(list)"
returns the number of elements contained in the list-value passed to the L parameter. The type of the return value is integer.

Example: Get the length of a list

Once a list-value is created, its length can be retrieved using the lst_len(L) function.

<block name="test" list="{lst('' 'a' 'b' 'c')}">
    <willbe name="test1" value="{lst_len(@list)}"/>
</block>

The code above creates a list-value called list containing 4 elements in the opening tag of <block>. A computed column is then created that displays the number of elements in the list value. In the example above, the return value is 4.