476
Chapter 12: Methods
propList()
Usage
-- Lingo syntax
propList()
[:]
propList(
string1
,
value1
,
string2
,
value2
,
...
)
propList(
#symbol1
,
value1
,
#symbol2
,
value2
,
...
)
[
#symbol1
:
value1
,
#symbol2
:
value2
,
...
]
// JavaScript syntax
propList();
propList(
string1
,
value1
,
string2
,
value2
,
...
);
Description
Top level function; creates a property list, where each element in the list consists of a name/value
pair.
When creating a property list using the syntax
propList()
or
[:]
(Lingo only), with or without
parameters, the index of list values begins with 1.
The maximum length of a single line of executable script is 256 characters. Large property lists
cannot be created using
propList()
. To create a property list with a large amount of data,
enclose the data in square brackets (
[]
), put the data into a field, and then assign the field to a
variable. The variable’s content is a list of the data.
Parameters
string1
,
string2
,
...
Optional. Strings that specify the name portions of the elements in
the list.
value1
,
value2
,
...
Optional. Values that specify the value portions of the elements in the list.
#symbol1
,
#symbol2
,
...
(Lingo only) Optional. Symbols that represent the name portions of
the elements in the list.
Example
This statement creates a property list with various properties and values, and then displays the
various property values in the Message window:
-- Lingo syntax
-- using propList()
colorList = propList(#top,"red", #sides,"blue", #bottom,"green")
-- using brackets
colorList = [#top:"red", #sides:"blue", #bottom:"green"]
put(colorList.top) -- "red"
put(colorList.sides) -- "blue"
put(colorList.bottom) -- "green"
// JavaScript syntax
var colorList = propList("top","red", "sides","blue", "bottom","green");
put(colorList.top) // red
put(colorList.sides) // blue
put(colorList.bottom) // green
See also
list()
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...