Using Director > Writing Scripts with Lingo > Using lists > Setting and retrieving items in a list |
![]() ![]() ![]() |
Setting and retrieving items in a list
Lingo lets you set and retrieve individual items in a list. The syntax differs for linear and property lists.
To set a value in a linear list:
Use the equals (=) operator. (You can also use the setAt
command introduced in earlier versions of Director.)
For example, the statement workerList[2] = "Tiffany"
makes Tiffany the new value for the second item in the list workerList.
To retrieve a value in a linear list:
Use the list variable followed by the number that indicates the value's position in the list. Place square brackets around the number. (You can also use the getAt
or getaProp
commands, which were introduced in earlier versions of Director.)
For example, in the linear list set workerList = ["Bruno ", "Heather ", "Carlos "]
, the expression workerList[2]
represents the second value in the list workerList. The value is Heather.
To set a value in a property list, do one of the following:
![]() |
Use the equals (=) operator. (You can also use the |
For example, the statement |
|
![]() |
Use dot syntax. |
For example, the statement |
To retrieve a value in a property list, do one of the following:
![]() |
Use the list variable followed by the name of the property associated with the value. Place square brackets around the property. (You can also use the |
For example, in the property list |
|
![]() |
Use dot syntax. |
For example, using the |
![]() ![]() ![]() |