User Guide

Lingo Dictionary 127
Values for charPosToLoc are in pixels from the top left corner of the field cast member. The
nthCharacter parameter is 1 for the first character in the field, 2 for the second character, and so on.
Example
The following statement determines the point where the fiftieth character in the field cast
member Headline appears and assigns the result to the variable location:
location = charPosToLoc(member "Headline", 50)
chars()
Syntax
chars(stringExpression, firstCharacter, lastCharacter)
Description
Function; identifies a substring of characters in stringExpression. The substring starts at
firstCharacter and ends at lastCharacter. The expressions firstCharacter and
lastCharacter must specify a position in the string.
If
firstCharacter and lastCharacter are equal, then a single character is returned from the string.
If
lastCharacter is greater than the string length, only a substring up to the length of the string is
identified. If
lastCharacter is before firstCharacter, the function returns the value EMPTY.
To see an example of
chars() used in a completed movie, see the Text movie in the Learning/
Lingo Examples folder inside the Director application folder.
Examples
This statement identifies the sixth character in the word Macromedia:
put chars("Macromedia", 6, 6)
-- "m"
This statement identifies the sixth through tenth characters of the word Macromedia:
put chars("Macromedia", 6, 10)
-- "media"
The following statement tries to identify the sixth through twentieth characters of the word
Macromedia. Because the word has only 10 characters, the result includes only the sixth through
tenth characters.
put chars ("Macromedia", 6, 20)
-- "media"
See also
char...of, length(), offset() (string function), number (characters)
charSpacing
Syntax
chunkExpression.charSpacing
Description
Text cast member property; enables specifying any additional spacing applied to each letter in the
chunkExpression portion of the text cast member.
A value less than 0 indicates less spacing between letters. A value greater than 0 indicates more
spacing between letters.