begin
clrscr;
sifre:
writeln('Dikkat!!!! ifreyi yanl?Ÿ girerseniz program kapanak demedi demeyin ');
writeln('ifreniz..');
readln(a);
if a<>1987 then
if h=2 then goto fatura;
if h=3 then goto arama;
if h=6 then goto ecikis;
ekle:
assign(dosya,'GOKHAN.txt');
{$i-} reset(dosya);kod:=ioresult;{$i+};
if kod<> 0 then rewrite(dosya);
repeat
clrscr;
gotoxy(30,10);write('SAYAÇ >');readln(kay.no);
if kay.no='' then GOTO MENU;
gotoxy(30,11);write('ADI >');readln(kay.isim);
gotoxy(30,12);write('SOYADI >');readln(kay.soy);
gotoxy(30,13);write('ADRES >');readln(kay.adres);
gotoxy(30,14);write('BORCU >');readln(kay.borcu);
gotoxy(20,25);writeLN('ABONE DOSYAYA KAYDEDILSIN MI? (E/H)') ;
repeat
tus:=upcase(readkey);
until tus in ['E','H'];
if tus='E' then
begin
kay.f:='*';
seek(dosya,filesize(dosya));
write(dosya,kay);
end;
textcolor(31);
writeln('ANA MENUYE DONMEK ICIN BIR TUSA BASINIZ...');READLN(HH);
until KEYPRESSED;
close(dosya);
GOTO MENU;
arama:
assign(dosya,'GOKHAN.txt');
{$i-} reset(dosya);kod:=ioresult;{$i+};
if kod<>0 then
begin
writeln('ABONE BULUNAMADI...');
tus:=readkey;
halt;
end;
repeat
clrscr;
gotoxy(20,13);write('ARADIGINIZ ABONENIN SAYAÇ NUMARASINI GIRINIZ>');readln(ara);
if ara='' then exit;
for i:=0 to filesize(dosya)-1 do
begin
seek(dosya,i);
read(dosya,kay);
if (kay.f='*') and (kay.no=ara) then
begin
clrscr;
gotoxy(30,10);writeln('SAYAÇ...: >',kay.no);
gotoxy(30,12);writeln('ADI >',kay.isim);
gotoxy(30,13);writeln('SOYADI >',kay.soy);
gotoxy(30,14);writeln('ADRES....>',kay.adres);
gotoxy(30,15);writeln('BORCU>',kay.borcu);
writeln;
gotoxy(20,20);write('ARADIGINIZ ABONE BU MU? (E/H)');
repeat
tus:=upcase(readkey);
until tus in ['E','H'];
if tus='E' then exit;
end;
end;
writeln;
gotoxy(27,15);writeln('ARADIGINIZ ABONE KAYITLARDA YOK...');
tus:=readkey;
until 1=2;
close(dosya);
writeln('ANA MENUYE DONMEK ICIN BIR TUSA BASINIZ...');
READKEY;
GOTO MENU;
fatura:
assign(dosya,'GOKHAN.txt');
{$i-} reset(dosya);kod:=ioresult;{$i+};
if kod<>0 then
begin
writeln('Kayıtlı abone yok...');
tus:=readkey;
halt;
end;
clrscr;
writeln(' SAYAC ADI SOYADI ADRESİ BORCU');
writeln('========================================= =================================');
s:=2;
k:=0;
for i:=0 to filesize(dosya)-1 do
begin
seek(dosya,i);
read(dosya,kay);
if kay.f='*' then
begin
s:=s+1;
k:=k+1;
gotoxy(1,s);write(kay.no);
gotoxy(10,s);write(kay.isim);
gotoxy(20,s);write(kay.soy);
gotoxy(27,s);write(kay.adres);
gotoxy(70,s);write(kay.borcu);
end;
if s>18 then
begin
gotoxy(20,21);
write('DIGER SAYFA ICIN BIR TUSA BASINIZ...');
tus:=readkey;
s:=2;
clrscr;
end;
end;
gotoxy(20,21);
write('FATURA KAYITLARI BITTI...');
tus:=readkey;
close(dosya);
gotoxy(15,23);writeln('ANA MENUYE DONMEK ICIN BIR TUSA BASINIZ...');
READKEY;
GOTO MENU;
ecikis:
writeln('Cikis');
END.