char...of
205
char...of
Usage
-- Lingo syntax
textMemberExpression
.char[
whichCharacter]
char
whichCharacter
of
fieldOrStringVariable
textMemberExpression
.char[
firstCharacter..lastCharacter
]
char
firstCharacter
to
lastCharacter
of
fieldOrStringVariable
Description
Keyword; identifies a character or a range of characters in a chunk expression. A chunk expression
is any character, word, item, or line in any source of text (such as field cast members and variables)
that holds a string.
•
An expression using
whichCharacter
identifies a specific character.
•
An expression using
firstCharacter
and
lastCharacter
identifies a range of characters.
The expressions must be integers that specify a character or range of characters in the chunk.
Characters include letters, numbers, punctuation marks, spaces, and control characters such as
Tab and Return.
You can test but not set the
char...of
keyword. Use the
put...into
command to modify the
characters in a string.
Example
This statement displays the first character of the string $9.00:
put(("$9.00").char[1..1])
-- "$"
This statement displays the entire string $9.00:
put(("$9.00").char[1..5])
-- "$9.00"
This statement changes the first five characters of the second word in the third line of a text
cast member:
member("quiz").line[3].word[2].char[1..5] = "?????"
See also
mouseMember
,
mouseItem
,
mouseLine
,
mouseWord
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...