Parameters
stringExpression
returned.
firstCharacter
lastCharacter
Example
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(),
charToNum()
Usage
(stringExpression).charToNum
charToNum(stringExpression)
Description
Function (Lingo only); returns the ASCII code that corresponds to the first character of an
expression.
The
charToNum()
combining keys, such as the Control key and another alphanumeric key.
Director treats uppercase and lowercase letters the same if you compare them using the equal sign
(
) operator; for example, the statement
=
Avoid problems by using
ASCII code to refer to the character.
In JavaScript syntax, use the String object's
Parameters
stringExpression
Required. A string that specifies the expression from which a substring is
Required. An integer that specifies the point at which the substring starts.
Required. An integer that specifies the point at which the substring ends.
offset() (string
function is especially useful for testing the ASCII value of characters created by
charToNum()
Required. A string that specifies the expression to test.
function),
number (characters)
returns the result 1 or
put ("M" = "m")
to return the ASCII code for a character and then use the
function.
charCodeAt()
.
TRUE
charToNum()
259
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers