442
number (words)
Syntax
the number of words in
chunkExpression
Description
Chunk expression; returns the number of words in the chunk expression specified by
chunkExpression
.
Chunk expressions are any character, word, item, or line in any container of characters.
Containers include field cast members and variables that hold strings, and specified characters,
words, items, lines, and ranges in containers.
To accomplish this functionality with text cast members, see
count
.
Note:
The
count()
function provides a more efficient alternative for determining the number of words in a
chunk expression.
Examples
This statement displays in the Message window the number of words in the string “Macromedia,
the multimedia company”:
put the number of words in "Macromedia, the multimedia company"
The result is 4.
This handler reverses the order of words in the string specified by the argument
wordList
:
on reverse wordList
theList = EMPTY
repeat with i = 1 to the number of words in wordList
put word i of wordList & " " before theList
end repeat
delete theList.char[thelist.char.count]
return theList
end
See also
count()
,
number (characters)
,
number (items)
,
number (lines)
,
word...of
number of members
Syntax
the number of members of castLib
whichCast
Description
Cast member property; indicates the number of the last cast member in the specified cast.
This property can be tested but not set.
Example
The following statement displays in the Message window the type of each cast member in the cast
Central Casting. The
number of members of castLib
property is used to determine how many
times the loop repeats.
repeat with i = 1 to the number of members of castLib("Central Casting")
put "Cast member" && i && "is a" && member(i, "Central Casting").type
end repeat
Summary of Contents for DIRECTOR MX-LINGO DICTIONARY
Page 1: ...Lingo Dictionary Macromedia Director MX...
Page 756: ...Index 756...