dosyalama işlemleri,kayıt,listeleme,arama,silme gibi işlemler.
uses crt;
type
kay=record
tele:string[11];
adres:string;
ad,soy,ara:string;
end;
var
sec:char;
tus:char;
i,x,y:byte;
dosya:file of kay;
dos:kay;
procedure ciz1;
begin
for i:=1 to 77 do begin
gotoxy(i,1); write(chr(205));
gotoxy(i,24); write(chr(205));
end;
for i:=1 to 24 do begin
gotoxy(1,i); write(chr(186));
gotoxy(77,i); writeln(chr(186));
end;
gotoxy(1,1); write(chr(201));
gotoxy(1,24); write(chr(200));
gotoxy(77,1); write(chr(187));
gotoxy(77,24); write(chr(188));
end;
procedure ciz;
begin
for i:=20 to 60 do begin
gotoxy(i,8); write(chr(205));
gotoxy(i,20); write(chr(205));
end;
for i:=8 to 20 do begin
gotoxy(20,i); write(chr(186));
gotoxy(60,i); writeln(chr(186));
end;
gotoxy(20,8); write(chr(201));
gotoxy(20,20); write(chr(200));
gotoxy(60,8); write(chr(187));
gotoxy(60,20); write(chr(188));
end;
procedure bilgi_girisi;
begin
assign(dosya,’d:deneme.dat’ );
{$i-} reset (dosya); {$i+}
if ioresult<>0 then rewrite(dosya);
repeat
seek(dosya,filesize(dosya));
gotoxy(2,2);
write(’Adınızı giriniz ==>’);readln(dos.ad);
gotoxy(2,3);
write(’Soyadınızı giriniz ==>’);readln(dos.soy);
gotoxy(2,4);
write(’adresi giriniz ==>’);readln(dos.adres);
gotoxy(2,5);
write(’Telefon numarasını giriniz ==>’);readln(dos.tele);
gotoxy(2,6);
write(dosya,dos);
writeln;
gotoxy(2,6);
writeln(’Başka işlem yapılsın mı?:(E,H,ESC)’);
repeat
tus:=readkey;
until tus in['H','h','E','e',#27];
until tus in ['H','h',#27]; clrscr;
close(dosya); ciz;
end;
procedure listele;
var
j:integer;
begin
assign(dosya,’d:deneme.dat’ );
{$i-} reset(dosya); {$i+}
if(ioresult=0) then begin
repeat
{while not eof(dosya) do begin}
gotoxy(1,2);
for j:=0 to filesize(dosya)-1 do
begin
seek(dosya,j);
read(dosya,dos);
gotoxy(2,2+j);
write(’ Ad =>’);
gotoxy(9,2+j);
write(dos.ad);
gotoxy(17,2+j);
write(’ Soyad =>’);
gotoxy(28,2+j);
write(dos.soy);
gotoxy(36,2+j);
write(’ Adres =>’);
gotoxy(46,2+j);
write(dos.adres);
gotoxy(52,2+j);
write(’ Telefon =>’);
gotoxy(65,2+j);
write(dos.tele);
writeln;
end;
gotoxy(2,23);
writeln(’ANA MENÜ:(E,H)’);
repeat
tus:=readkey;
until tus in['H','h','E','e'];
until tus in ['E','e']; clrscr;
close(dosya);
ciz;
end;
end;
procedure arama;
var
ara:string;
begin
{$i-} reset(dosya) {$i+};
if(ioresult=0) then begin
repeat
gotoxy(2,2);
write(’Aramak istediğiniz adı giriniz:’);readln(ara);
{while not eof(dosya) do begin}
for i:=0 to filesize(dosya)-1 do
begin
seek(dosya,i);
read(dosya,dos);
if ara=dos.ad then begin
gotoxy(2,3);
write(’ Ad:’); write(dos.ad:5);
write(’ Soyad:’); write(dos.soy:5);
write(’ Maaşı:’); write(dos.adres:5);
write(’ Telefon:’); write(dos.tele:5);
break;
end;
writeln;
end;
gotoxy(2,23);
writeln(’ANA MENÜ:(E,H)’);
repeat
tus:=readkey;
until tus in['H','h','E','e'];
until tus in ['E','e']; clrscr;
close(dosya);
ciz;
end;
end;
procedure telif;
begin
repeat
gotoxy(25,2);
writeln(’KERİM KORKMAZ’);
gotoxy(25,3);
writeln(’kerim_korkmaz_53@hotmail.com’);
gotoxy(25,5);
writeln(’H.KEMAL ANADOLU MESLEK LİSESİ RİZE’);
gotoxy(25,7);
writeln(’DERS ÖĞRETMENİ ÖZGÜR KUYUCU’);
gotoxy(25,8);
writeln(’yakmoz@hotmail.com’);
for i:=1 to 10 do
begin
writeln;
end;
gotoxy(2,23);
writeln(’ANA MENÜ:(E,H)’);
repeat
tus:=readkey;
until tus in['H','h','E','e'];
until tus in ['E','e']; clrscr;
ciz;
end;
procedure kayit_silme;
var
ara:string;
j:integer;
begin
{$i-} reset(dosya); {$i+}
if ioresult=0 then begin repeat
if filesize(dosya)>0 then
begin
gotoxy(2,2);
write(’Silinecek kişinin adı ==>’); readln(ara);
gotoxy(2,3);
write(’Adı ==>’); write(dos.ad);
gotoxy(2,4);
write(’Soyadı ==>’); write(dos.soy);
gotoxy(2,5);
write(’Maaşı ==>’); write(dos.adres);
gotoxy(2,6);
write(’Telefonu ==>’); writeln(dos.tele);
for i:=0 to filesize(dosya)-1 do
begin
seek(dosya,i); read(dosya,dos);
j:=1;
if ara=dos.ad then
break; end;
if ara=dos.ad then begin
for j:=i+1 to filesize(dosya)-1 do
begin
seek(dosya,j); read(dosya,dos);
seek(dosya,j-1);
write(dosya,dos);
end;
seek(dosya,filesize(dosya)-1);
truncate(dosya);
gotoxy(2,7);
writeln(’Kayıt silindi’);
end;
end else begin
gotoxy(5,5) ;write(’Dosyada kayıt yok’);end;
gotoxy(2,23);
writeln(’ANA MENÜ:(E,H)’);
repeat
tus:=readkey;
until tus in['H','h','E','e'];
until tus in ['E','e']; clrscr;
close(dosya);
ciz;
end;
end;
procedure duzeltme;
var
ara:string;
begin
repeat
{$i-} reset(dosya); {$i+}
if ioresult=0 then begin
gotoxy(2,2);
write(’Düzeltilecek ismi gir ==>’); readln(ara);
for i:=0 to filesize(dosya)-1 do begin
seek(dosya,i); read(dosya,dos);
if (ara=dos.ad) then
break;
end;
if (ara=dos.ad) then begin
seek(dosya,i);
gotoxy(2,3);
write(’Yeni ismi gir ==>’); readln(dos.ad);
gotoxy(2,4);
write(’Yeni soyad gir ==>’); readln(dos.soy);
gotoxy(2,5);
write(’Yeni maaşı gir ==>’); readln(dos.adres);
gotoxy(2,6);
write(’Yeni telefonu gir ==>’); readln(dos.tele);
gotoxy(2,7);
write(dosya,dos);
end
else begin
gotoxy(24,2);
write(’Dosyada kayıt yok’);
end;
gotoxy(2,23);
writeln(’ANA MENÜ:(E,H)’);
repeat
tus:=readkey;
until tus in['H','h','E','e'];
end;
until tus in ['E','e'];
clrscr;
ciz;
end;
begin clrscr;
assign(dosya,’d:deneme.dat’);
ciz;
x:=30;y:=11;
repeat
repeat
gotoxy(23,9);
textcolor(15);
writeln(’<===========M E N Ü============>’);
gotoxy(30,11);
writeln(’1-Bilgi girişi’);
gotoxy(30,12);
writeln(’2-Listeleme’);
gotoxy(30,13);
writeln(’3-Arama’);
gotoxy(30,14);
writeln(’4-Kayıt Silme’);
gotoxy(30,15);
writeln(’5-Kayıt Düzeltme’);
gotoxy(30,16);
writeln(’6-Çıkış’);
gotoxy(30,17);
writeln(’7-Telif Hakkı’);
gotoxy(x,y);
sec:=readkey;
if sec=’s’ then
y:=y+1;
if y=18 then
y:=11;
if sec=’w’ then
y:=y-1;
if y=10 then
y:=17;
until sec in['1','2','3','4','5','6','7',#27,#13];
clrscr;
if sec=#13 then begin ciz1;
if y=11 then bilgi_girisi
else if y=12 then listele
else if y=13 then arama
else if y=14 then kayit_silme
else if y=15 then duzeltme
else if y=16 then exit
else if y=17 then telif; end;
case sec of
‘1′: begin ciz1;bilgi_girisi; end;
‘2′: begin ciz1;listele; end;
‘3′: begin ciz1;arama; end;
‘4′: begin ciz1;kayit_silme; end;
‘5′: begin ciz1;duzeltme; end;
‘6′: begin exit; end;
‘7′: begin ciz1;telif end;
end;
until tus=#27;
readln;
end.Â
dosyalama işlemleri,kayıt,listeleme,arama,silme | dosyalama işlemleri

