User Guide
314 Chapter 12: Methods
Example
This statement finds the first empty cast member on or after cast member 100:
-- Lingo syntax
trace(castLib(1).findEmpty(member(100)))
// JavaScript syntax
trace(castLib(1).findEmpty(member(100)));
See also
Cast Library, Member
findPos
Usage
list.findPos(property)
findPos(list, property)
Description
List command; identifies the position of a property in a property list.
Using
findPos with linear lists returns a bogus number if the value of property is a number and
a script error if the value of
property is a string.
The
findPos command performs the same function as the findPosNear command, except that
findPos is VOID when the specified property is not in the list.
Parameters
property
Required. The property whose position is identified.
Example
This statement identifies the position of the property c in the list Answers, which consists of
[#a:10, #b:12, #c:15, #d:22]:
Answers.findPos(#c)
The result is 3, because c is the third property in the list.
See also
findPosNear, sort
findPosNear
Usage
sortedList.findPosNear(valueOrProperty)
findPosNear(sortedList, valueOrProperty)
Description
List command; for sorted lists only, identifies the position of an item in a 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.