unit CompareStr;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: CompareStr
// Routine: SysUtils.CompareStr

// BeginCode
{
The following code compares String1, 'STEVE', to String2,
'STEVe'. Note that CompareStr returns a number less than 0
because the value of 'e' is greater than the value of 'E'.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  String1, String2 : string;
  I : Integer;
begin
  String1 := 'STEVE';
  String2 := 'STEVe';
  I := SysUtils.CompareStr(String1, String2);  { the value of I is < 0 }
  Edit1.Text := InttoStr(I);
  if I <> 0 then
    MessageDlg('The strings are not equal', mtWarning, [mbOK], 0)
end;
// EndCode
// EndExample: CompareStr
end.
