User Tools

Site Tools


syntax:functions:pick

Pick(index, text_list, delimiter)

Category: Special function


Description

This function returns the value in index position within text_list, a list of text values separated by delimiter.


Use cases

This function makes it possible to define EasyMorph expressions externally using parameters.


Arguments

ArgumentTypeDescription
indexNumberThe position of the value to return from text_list.
text_listTextA text-based delimited list of values to search for value.
delimiterTextThe character(s) used to separate the individual values in text_list. This can be more than one character.

Return value type: Text


Remarks

Regardless of what the return value appears to be (number, Boolean, text), this function always returns a text value.

The values in the delimited string (text_list) are always considered text, even if they look like a number.

This function returns an empty value if index exceeds the number of delimited values in text_list.

Delimiter may contain more than one character.


Examples

pick(3, 'Please don’t stop the music', ' ')  //Returns 'stop'
pick(2, '2,4,6,8,10,12', ',')  //Returns '4'  (This is a text value, not a number.)
pick(5, 'Sally;Bob;Mary;Sue', ';')  //Returns an empty value  (Only 4 values within the text list.)


See also

syntax/functions/pick.txt · Last modified: 2021/09/13 23:00 by craigt