ASCII(Source: String): Integer;
Source. The string, for which one should get ASCII code of the first character.
The ASCII method returns the ASCII code of the first character in the string passed as the input parameter.
To get a character in the ASCII encoding, use the Char.ASCII method.
Sub UserProc;
Var
s: String;
i: Integer;
Begin
s := "String";
// Get the ASCII code of the first string character
i := String.ASCII(s);
Debug.WriteLine("ASCII(""" + s + """) = " + i.ToString);
End Sub UserProc;
After executing the example the ASCII code of the first string character is displayed in the console window.
See also: