unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    LabeledEdit1: TLabeledEdit;
    LabeledEdit2: TLabeledEdit;
    Bevel1: TBevel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var n,k:integer;
    plik1: TFileStream;
    znak:char;
begin
  k:=StrtoInt(LabeledEdit1.Text);
  plik1:=Tfilestream.Create('liczba.int',fmCreate);
  n:=plik1.Write(k,Sizeof(k));
  plik1.Free;
end;

procedure TForm1.Button2Click(Sender: TObject);
var n,d:integer;
    plik1: TFileStream;
begin
  plik1:=Tfilestream.Create('liczba.int',fmOpenRead);
  n:=plik1.Read(d,Sizeof(d));
  plik1.Free;
  LabeledEdit2.Text:=InttoStr(d);
end;
end.
