MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual page 401

Table of Contents

Advertisement

Adding and deleting items in a list
You can add or delete items in a list by using the following commands. See entries for individual
commands in the Lingo Dictionary.
To add an item at the end of a list, use the
To add an item at its proper position in a sorted list, use the
To add an item at a specific place in a linear list, use the
To add an item at a specific position in a property list, use the
To delete an item from a list, use the
To replace an item in a list, use the
You do not have to explicitly remove lists. Lists are automatically removed when they are no
longer referred to by any variable. Other types of objects must be removed explicitly, by setting
variables that refer to them to
Copying lists
Assigning a list to a variable and then assigning that variable to a second variable does not make a
separate copy of the list. For example, the statement
list that contains the names of two continents. The statement
assigns the same list to the variable
using the statement
also. This happens because both variable names point to the same object
continentList
in memory.
To create a copy of a list that is independent of the first list:
Use the
duplicate()
For example, this statement creates a list and assigns it to the variable
oldList = ["a", "b", "c"]
This statement uses the
assign it to the variable
newList = duplicate(oldList)
After
is created, editing either
newList
Sorting lists
Lists can be unsorted. However, Lingo can sort a list in alphanumeric order, with numbers before
strings. Strings are sorted according to their initial letters, regardless of how many characters they
contain. Sorted lists perform slightly faster than unsorted lists.
Lingo sorts a linear list according to the values in the list. Lingo sorts a property list according to
the properties in the list.
To sort a list:
Use the
command followed by the list's name. See
sort
deleteAt
setAt
.
VOID
continentList
add landList, "Australia"
function. See
duplicate() (list function)
function to make an independent copy of the list and
duplicate()
:
newList
oldList
command.
append
or
add
command.
addAt
addProp
,
, or
deleteOne
deleteProp
or
command.
setaProp
landList = ["Asia", "Africa"]
continentList = landList
. However, adding Australia to
automatically adds Australia to
or
has no effect on the other.
newList
in the Lingo Dictionary.
sort
command.
addProp
command.
command.
creates a
landList
in the Lingo Dictionary.
:
oldList
Writing Scripts with Lingo 401

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director mx

Table of Contents