unit SystemInt;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemInt
// Routine: System.Int

// BeginCode
{
Click the button to display the integer part of any positive or
negative real number.
}
procedure TForm1.Button1Click(Sender: TObject);
var 
  R: Real;
begin
  R := StrToFloat(Edit1.Text);     { 123.456 }
  R := Int(R);                     { 123.0 }
  Edit2.Text := FloatToStr(R);
end;
// EndCode
// EndExample: SystemInt
end.
