ASCII(Source: Char): Integer;
Source. Variable which value is required to recode.
The ASCII method recodes the value of the specified variable from the UTF-16 encoding to the ASCII encoding.
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: