procedure TForm1.Button1Click(Sender: TObject);
var b: array [0..31] of byte;
i:integer;
h:integer;
begin
for i := low(b) to High(b) do
begin
b[i] := i;
end;
h := FileCreate('f:/test.dat');
FileWrite(h, b, sizeof(b));
FileClose(h);
end;
procedure TForm1.Button2Click(Sender: TObject);
var b: array [0..31] of byte;
i:integer;
h:integer;
begin
h := FileOpen('f:/test.dat',GENERIC_READ);
FileRead(h, b, sizeof(b));
FileClose(h);
for i:=0 to 31 do
begin
showmessage(inttostr(b[i]));
end;
end;