String.ASCII

Syntax

ASCII(Source: String): Integer;

Parameters

Source. The string, for which one should get ASCII code of the first character.

Description

The ASCII method returns the ASCII code of the first character in the string passed as the input parameter.

Comments

To get a character in the ASCII encoding, use the Char.ASCII method.

Example

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:

String