User Guide
898 Chapter 14: Properties
number (system)
Usage
the number of castLibs
Description
System property; returns the number of casts that are in the current movie.
This property can be tested but not set.
Example
This repeat loop uses the Message window to display the number of cast members that are in each
of the movie’s casts:
repeat with n = 1 to the number of castLibs
put castLib(n).name && "contains" && the number of \
members of castLib(n) && "cast members."
end repeat
number (words)
Usage
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.
Example
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