User Tools

Site Tools

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



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)


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:




val_return_ascii_value_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)