ASCII(Source: Char): Integer;
Source. The character, from which ASCII code must be obtained.
The ASCII property returns the ACSII code of the character passed as the input parameter.
To get the first character of string in the ASCII encoding, use the String.ASCII method.
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: