Delphi Berlin (Test ord function)

Description
The Ord function returns an integer value for any ordinal type Arg.

It is principally used to convert characters or enumerations into their numeric equivalents.

procedure TForm2.FormCreate(Sender: TObject);
var
  Str: string;
  i: byte;
begin
  Str := 'ABCDE';
  for i := 1 to length(Str)-1 do
   showmessage(Str[i]+ format('=%d', [ord(Str[i])]) );
end;

Comments