Char.ASCII

Syntax

ASCII(Source: Char): Integer;

Parameters

Source. Variable which value is required to recode.

Description

The ASCII method recodes the value of the specified variable from the UTF-16 encoding to the ASCII encoding.

Comments

To get the first character of string in the ASCII encoding, use the String.ASCII method.

Example

Sub UserProc;
Var
    c: Char;
    i: Integer;
Begin
    c := 
'a';
    
// Get the ASCII code of character
    i := Char.ASCII(c);
    Debug.WriteLine(
"ASCII('" + c + "') = " + i.ToString);
End Sub UserProc;

After executing the example the ASCII code of character is displayed in the console window.

See also:

Char