Chapter 3
52
[ ] (bracket access)
Syntax
textExpression
[
chunkNumberBeingAddressed
]
textExpression
[
firstChunk..lastChunk
]
Description
Operator; allows a chunk expression to be addressed by number. Useful for finding the nth
chunk in the expression. The chunk can be a word, line, character, paragraph, or other Text cast
member chunk.
Example
This outputs the first word of the third line in the text cast member First Names:
put member("First Names").text.line[3].word[1]
[ ] (list)
Syntax
[
entry1
,
entry2
,
entry3
, ...]
Description
List operator; specifies that the entries within the brackets are one of four types of lists:
•
Unsorted linear lists
•
Sorted linear lists
•
Unsorted property lists
•
Sorted property lists
Each entry in a linear list is a single value that has no other property associated with it. Each entry
in a property list consists of a property and a value. The property appears before the value and is
separated from the value by a colon. You cannot store a property in a linear list. When using
strings as entries in a list, enclose the string in quotation marks.
For example, [6, 3, 8] is a linear list. The numbers have no properties associated with them.
However, [#gears:6, #balls:3, #ramps:8] is a property list. Each number has a property—in this
case, a type of machinery—associated with it. This property list could be useful for tracking the
number of each type of machinery currently on the Stage in a mechanical simulation. Properties
can appear more than once in a property list.
Lists can be sorted in alphanumeric order. A sorted linear list is ordered by the values in the list. A
sorted property list is ordered by the properties in the list. You sort a list by using the appropriate
command for a linear list or property list.
•
In linear lists, symbols and strings are case sensitive.
•
In property lists, symbols aren’t case sensitive, but strings are case sensitive.
A linear list or property list can contain no values at all. An empty list consists of two square
brackets ([ ]). To create or clear a linear list, set the list to
[ ]
. To create or clear a property list, set
the list to [:].
You can modify, test, or read items in a list.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...