Char.ASCII

Syntax

ASCII(Source: Char): Integer;

Parameters

Source. The character, from which ASCII code must be obtained.

Description

The ASCII property returns the ACSII code of the character passed as the input parameter.

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