String.ASCII

Syntax

ASCII(Source: String): Integer;

Parameters

Source. Variable which value is required to recode.

Description

The ASCII method recodes value of the specified variable first character from the UTF-16 encoding to the ASCII encoding.

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