unit SystemInc;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemInc
// Routine: System.Inc

// BeginCode
{
This example requires two buttons and two text fields.  The
text fields can be set to any integer and long integer value.
Click the buttons to execute Inc.
}
procedure TForm1.Button1Click(Sender: TObject);
var
  IntVar: Integer;
begin
  IntVar := StrToInt(Edit1.Text);
  Inc(IntVar);
  Edit1.Text := IntToStr(IntVar);		{ IntVar := IntVar + 1 }
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  LongintVar: Longint;
begin
  LongintVar := StrToInt(Edit2.Text);
  Inc(LongintVar, 5);
  Edit2.Text := IntToStr(LongintVar);	{ LongintVar := LongintVar + 5 }
end;
// EndCode
// EndExample: SystemInc
end.
