Chapter 16
400
To set a value in a property list, do one of the following:
•
Use the equals (=) operator. (You can also use the
setAProp
command, which was introduced
in earlier versions of Director.)
For example, the statement
foodList[#Bruno] = "sushi"
makes sushi the new value
associated with the property Bruno.
•
Use dot syntax.
•
For example, the statement
foodList.Bruno = "sushi"
makes sushi the new value
associated with the property Bruno in the list
foodList
.
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
getaProp
or
getAt
commands, or
the
getPropAt()
function, which were introduced in earlier versions of Director.)
For example, in the property list
foodList = [#breakfast:"Waffles", #lunch:"Tofu
Burger", #dinner:"Hungarian Goulash"]
,
the expression
foodList[#breakfast]
represents the value associated with the property
#breakfast
. The value is Waffles.
•
Use dot syntax.
For example, using the
foodList
property list above,
foodList.breakfast
represents the
value Waffles.
Checking items in a list
You can determine the characteristics of a list and the number of items the list contains by
using the following commands and functions. See entries for individual commands in the
Lingo Dictionary.
•
To display the contents of a list, use the
put
command followed by the variable that
contains the list.
•
To determine the number of items in a list, use the
count()
function.
•
To determine a list’s type, use the
ilk()
function.
•
To determine the maximum value in a list, use the
max()
function.
•
To determine the minimum value in a list, use the
min()
function.
•
To determine the position of a specific property, use the
findPos
,
findPosNear
, or
getOne
command.
Summary of Contents for Director MX
Page 1: ...Using Director MX Macromedia Director MX ...
Page 12: ...Contents 12 ...
Page 156: ...Chapter 4 156 ...
Page 202: ...Chapter 6 202 ...
Page 244: ...Chapter 7 244 ...
Page 292: ...Chapter 10 292 ...
Page 330: ...Chapter 12 330 ...
Page 356: ...Chapter 13 356 ...
Page 372: ...Chapter 14 372 ...
Page 442: ...Chapter 16 442 ...
Page 472: ...Chapter 18 472 ...
Page 520: ...Chapter 19 520 ...
Page 536: ...Chapter 20 536 ...
Page 562: ...Chapter 23 562 ...
Page 566: ...Chapter 24 566 ...
Page 602: ...Chapter 27 602 ...