![MACROMEDIA DIRECTOR MX 2004 Reference Download Page 894](http://html1.mh-extra.com/html/macromedia/director-mx-2004/director-mx-2004_reference_687516894.webp)
894
Chapter 14: Properties
Example
This statement displays the number of characters in the string “Macromedia, the Multimedia
Company” in the Message window:
put the number of chars in "Macromedia, the Multimedia Company"
The result is 34.
This statement sets the variable
charCounter
to the number of characters in the word i located in
the string Names:
charCounter = the number of chars in member("Names").word[i]
You can accomplish the same thing with text cast members using the syntax:
charCounter = member("Names").word[i].char.count
See also
length()
,
char...of
,
count()
,
number (items)
,
number (lines)
,
number (words)
number (items)
Usage
the number of items in
chunkExpression
Description
Chunk expression; returns a count of the items in a chunk expression. An item chunk is any
sequence of characters delimited by commas.
Chunk expressions are any character, word, item, or line in any container of characters.
Containers include fields (field cast members) and variables that hold strings, and specified
characters, words, items, lines, and ranges in containers.
Note:
The
count()
function provides a more efficient alternative for determining the number of items
in a chunk expression.
Example
This statement displays the number of items in the string “Macromedia, the Multimedia
Company” in the Message window:
put the number of items in "Macromedia, the Multimedia Company"
The result is 2.
This statement sets the variable
itemCounter
to the number of items in the field Names:
itemCounter = the number of items in member("Names").text
You can accomplish the same thing with text cast members using the syntax:
itemCounter = member("Names").item.count
See also
item...of
,
count()
,
number (characters)
,
number (lines)
,
number (words)
Summary of Contents for DIRECTOR MX 2004
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...