type
TMember = record
Name : string[50];
eMail : string[30];
Posts : LongInt;
end;

var Members : array[1..50] of TMember;


var F : file of TMember;


AssignFile(F, 'Members.dat')

var F : file of TMember;
begin
AssignFile(F,'members.dat');
Rewrite(F);
try
for i:= 1 to 50 do
Write (F, Members);
finally
CloseFile(F);
end;
end;

var Member: TMember
F : file of TMember;
begin
AssignFile(F,'members.dat');
Reset(F);
try
while not Eof(F) do begin
Read (F, Member);
{ DoSomethingWithMember; }
end;
finally
CloseFile(F);
end;
end;


{go back to the beginning - the first record}
Seek(F, 0);

{go to the 5-th record}
Seek(F, 5);

{Jump to the end - "after" the last record}
Seek(F, FileSize(F));

procedure ChangeEMail
(const RecN : integer; const NewEMail : string);
var DummyMember : TMember;
begin
{assign, open, exception handling block}
Seek(F, RecN);
Read(F, DummyMember);
DummyMember.Email := NewEMail;
{read moves to the next record, we have to
go back to the original record, then write}
Seek(F, RecN);
Write(F, DummyMember);
{close file}
end;

Beğeniler: 0
Favoriler: 0
İzlenmeler: 856
favori
like
share
turkbey Tarih: 25.09.2007 00:47
tsk
alisisman61 Tarih: 14.03.2006 18:56
ellerie sağlık arkadaşım
ofo_man Tarih: 14.03.2006 13:23
eline sağlık üstat..Bu pascalda cekilmiyo yaff