unit SystemOrd;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemOrd
// Routine: System.Ord

// BeginCode
{
This example displays the ordinal value for different enumerations.
}
procedure TForm1.Button1Click(Sender: TObject);
type
   Colors = (RED,BLUE,GREEN);
var
  S: string;
begin
  S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #13#10;
  S := S + 'The ASCII code for "c" is ' + IntToStr(Ord('c')) +  ' decimal';
  MessageDlg(S, mtInformation, [mbOk], 0, mbOK);
end;
// EndCode
// EndExample: SystemOrd
end.
