User Guide

230 Chapter 12: Methods
add
Usage
-- Lingo syntax
linearList.add(value)
// JavaScript syntax
array.push(value)
Description
List command; for linear lists only, adds a value to a linear list. For a sorted list, the value is placed
in its proper order. For an unsorted list, the value is added to the end of the list.
This command returns an error when used on a property list.
Note: Don’t confuse the add command with the + operator used for addition or the & operator used to
concatenate strings.
Parameters
value
Required. A value to add to the linear list.
Example
These statements add the value 2 to the list named bids. The resulting list is [3, 4, 1, 2].
-- Lingo syntax
bids = [3, 4, 1]
bids.add(2)
// JavaScript syntax
bids = new Array(3,4,1);
bids.push(2);
This statement adds 2 to the sorted linear list [1, 4, 5]. The new item remains in alphanumeric
order because the list is sorted.
-- Lingo syntax
bids.add(2)
// JavaScript syntax
bids.push(2);
// to sort the list using JavaScript syntax
bids.sort();
See also
sort
add (3D texture)
Usage
--Lingo syntax
member(whichCastmember).model(whichModel).meshdeform.mesh[index].\
textureLayer.add()
// JavaScript syntax
member(whichCastmember).model(whichModel).meshdeform.mesh[index].\
textureLayer.add()