226
Chapter 11: Keywords
word...of
Usage
-- Lingo syntax
member(
whichCastMember
).word[
whichWord
]
textMemberExpression
.word[
whichWord
]
chunkExpression.word[
whichWord
]
word
whichWord
of
fieldOrStringVariable
fieldOrStringVariable. word[
whichWord
]
textMemberExpression
.word[
firstWord
..
lastWord
]
member(
whichCastMember
).word[
firstWord
..
lastWord
]
word
firstWord
to
lastWord
of
chunkExpression
chunkExpression.word[
whichWord
..
lastWord
]
Description
Chunk expression; specifies a word or a range of words in a chunk expression. A word chunk is
any sequence of characters delimited by spaces. (Any non-visible character, such as a tab or
carriage return, is considered a space.)
The expressions
whichWord
,
firstWord
, and
lastWord
must evaluate to integers that specify a
word in the chunk.
Chunk expressions refer to any character, word, item, or line in any source of characters. Sources
of characters include field and text cast members and variables that hold strings.
To see an example of
word...of
used in a completed movie, see the Text movie in the Learning/
Lingo Examples folder inside the Director application folder.
Example
These statements set the variable named
animalList
to the string “fox dog cat” and then insert
the word
elk
before the second word of the list:
animalList = "fox dog cat"
put "elk" before animalList.word[2]
The result is the string “fox elk dog cat”.
This statement tells Director to display the fifth word of the same string in the Message window:
put "fox elk dog cat".word[5]
Because there is no fifth word in this string, the Message window displays two quotation marks
(""), which indicate an empty string.
See also
char...of
,
line...of
,
item...of
,
count()
,
number (words)
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...