Lingo Dictionary > G-K > getPos() |  |

getPos()

Syntax

    list.getPos(value)
    getPos(list, value)

Description

List function; identifies the position of the value specified by `value` in the list specified by `list`. When the specified value is not in the list, the `getPos` command returns the value 0.

For values contained in the list more than once, only the first occurrence is displayed. This command performs the same function as the `getOne` command when used for linear lists.

Example

This statement identifies the position of the value 12 in the list Answers, which consists of [#a:10, #b:12, #c:15, #d:22]:

    put Answers.getPos(12)

The result is 2, because 12 is the second value in the list.

See also

`getOne()`