Returns information about the type of character.
CharactType("A") // the function returns ctAlpha|ctUppercase
CharactType("é") // the function returns ctAlpha|ctLowercase|ctAccent
// Checks if a character is a letter
IF BinaryAND(CharactType("c"), ctAlpha) <> 0 THEN
Trace("This character is a letter")
END
Syntax
<Result> = CharactType(<Character>)
<Result>: Integer constant (or combination of constants)
Type of character analyzed: | |
ctAccent | Accented or diacritical character. The ctAccent constant can only be combined with ctAlpha. |
ctAlpha | Letter. |
ctLowercase | Lowercase character. The ctLowercase constant can only be combined with ctAlpha. |
ctNumeric | Numeric character. |
ctPunctuation | Punctuation character. |
ctSpace | Space. |
ctUppercase | Uppercase character. The ctUppercase constant can only be combined with ctAlpha. |
<Character>: Character string
Character to use.
Remarks
- The character 0 returns 0.
- Various character characteristics can be combined: a character can be an accented letter. In this case, the following constants can be combined: ctAccent, ctAlpha, ctUppercase and ctLowercase.
To check a single characteristic (for example, if the character is a letter): it is recommended to test the corresponding constant with BinaryAND or with the "&" operator. For example:
// Checks if a character is a letter
IF BinaryAND(CharactType("c"), ctAlpha) <> 0 THEN
Trace("This character is a letter")
END
Business / UI classification: Neutral code