User Tools

Site Tools


val_return_ascii_value_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== VAL (return character code value) ====== Previous pageReturn to chapter overviewNext page

VAL(character)

blk2blue.jpg

VAL Returns a character code value.
character A one character string containing an ANSI or Unicode character.

The VAL procedure returns the numeric code of a character. If the compiler can determine type of parameter (literal string or variable), it returns

a result of BYTE (for ANSI strings) or a USHORT (for Unicode strings). If the type of parameter can't be determined the compiler generates code to push its value to the string stack and returns a result of SIGNED type. To force a specific encoding of the character parameter you can use the TOANSI or TOUNICODE functions .

Return Data Type:     BYTE, USHORT or SIGNED (See above)

Example:

VAL('A')          !RETURNS 65

VAL('z')          !RETURNS 122

VAL('Ж')          !RETURNS 1046

VAL('Σ')          !RETURNS 933

CharCode = VAL(StrChar)      !Get the character code value of the character

See Also:

CHR

TOUNICODE

TOANSI

val_return_ascii_value_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1