next up previous
Next: Types of Scripts Up: Multimedia Programming:Scripting (Lingo) Previous: Lingo operators

Lingo Lists

In Lingo, Lists provide an efficient way to track and update an array of data such as a series of names or the values assigned to a set of variables.

Lists are basically a set of elements separated by commas. Lingo encloses the set of values in square brackets. A simple example of a list is a list of numbers such as [1, 4, 2].

Lingo can create, retrieve, add to, reorder, sort, or substitute a list's contents. Director offers two types of lists:

Linear lists
-- In which each element is a single value. For example, this list is a simple set of numbers:
[100, 150, 300, 350]

Property lists
-- In which each element contains two values separated by a colon. The first value is a property. The second value is the value associated with that property.

For example, this list could be a sprite's Stage coordinates, with a value for each one:

[#left:100, #top:150, #right:300, #bottom:350]

Lingo has many functions that operate on lists. You can display lists (put), find list lengths (count()), find largest and smallest elements in the list (max(), min()), add and delete items in a list (append, add, .....), copy (duplicate()), and sort lists. See the Lingo dictionary for complete details..


next up previous
Next: Types of Scripts Up: Multimedia Programming:Scripting (Lingo) Previous: Lingo operators
Dave Marshall
10/4/2001