Lingo Dictionary > D-F > findPosNear |  |

findPosNear

Syntax

    sortedList.findPosNear(valueOrProperty)
    findPosNear(sortedList, valueOrProperty)

Description

List command; for sorted lists only, identifies the position of the item specified by `valueOrProperty` in the specified sorted list.

The `findPosNear` command works only with sorted lists. Replace `valueOrProperty` with a value for sorted linear lists, and with a property for sorted property lists.

The `findPosNear` command is similar to the `findPos` command, except that when the specified property is not in the list, the `findPosNear` command identifies the position of the value with the most similar alphanumeric name. This command is useful in finding the name that is the closest match in a sorted directory of names.

Example

This statement identifies the position of a property in the sorted list Answers, which consists of [#Nile:2, #Pharaoh:4, #Raja:0]:

    Answers.findPosNear(#Ni)

The result is 1, because Ni most closely matches Nile, the first property in the list.

See also

`findPos`