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