User Guide
Chapter 3128
The default value is 0, which results in default spacing between letters.
Example
The following handler increases the current character spacing of the third through fifth words
within the text cast member myCaption by a value of 2:
on myCharSpacer
mySpaceValue = member("myCaption").word[3..5].charSpacing
member("myCaption").word[3..5].charSpacing = (mySpaceValue + 2)
end
charToNum()
Syntax
(stringExpression).charToNum
charToNum(stringExpression)
Description
Function; returns the ASCII code that corresponds to the first character of stringExpression.
The
charToNum() function is especially useful for testing the ASCII value of characters created by
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 put ("M" = "m") returns the result 1 or TRUE.
Avoid problems by using
charToNum() to return the ASCII code for a character and then use the
ASCII code to refer to the character.
Examples
This statement displays the ASCII code for the letter A:
put ("A").charToNum
-- 65
The following comparison determines whether the letter entered is a capital A, and then navigates
to either a correct sequence or incorrect sequence in the Score:
on CheckKeyHit theKey
if (theKey).charToNum = 65 then
go "Correct Answer"
else
go "Wrong Answer"
end if
end
See also
numToChar()