Using Director > Writing Scripts with Lingo > Using lists > Creating linear lists

 

Creating linear lists

The most common way to create a linear list is to use the list operator ([ ]). You can also use the list() function to create a linear list.

To create a linear list, do one of the following:

Place the list elements within the list operator ([ ]).

Specify the list's elements as parameters of the list() function. (This function is useful when you use a keyboard that doesn't provide square brackets.)

In both cases, you use commas to separate items in the list.

For example, the following statements have the same effect; each statement creates a linear list of three names:

set workerList = ["Bruno", "Heather", "Carlos"]
set workerList = list("Bruno", "Heather", "Carlos")

To create an empty linear list:

Set the list to [ ].