lst_pick(L;I)

Find the value of an element in a list-value from a specified index position.

Syntax

lst_pick(L;I)

Input

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

If L is omitted, an error is returned.

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

A list-value

I integer The index position of the value to be returned

If I is omitted, an error is returned.

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

A scalar value

Return Value

Returns the current value found at index position I of the list-value specified by L.

Sample Usage

As an example, the following function call:
list="{lst(1 'a' 'A' 3.14159)}"
element_value="lst_pick(list;4)"
returns the value found at index position 4 in list. In this case, the value is an approximation of pi.

Example: Get the value of element at the I'th position

Once a list-value is created, values at any index position can be retrieved using the lst_pick(L;I) function.

<base table="default.lonely"/>
<let list="{lst(',not,a,moon,'',a,spacestation!')}" 
 not="1" is="2">
<foreach x="That\'s {lst_pick({@list};{@not})} 
 It\'s{lst_pick({@list};{@is})}" tally_="@i">
<willbe name="x{@i}" value="'{@x}'"/>
</foreach>
</let>
<colord hide="c1"/>

The code above returns a series of computed columns where each word in the phrase That's not a moon, it's a spacestation! is contained in its own column.