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.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...