Programalama > PASCAL

Etiketler: telefon, rehberi

Ort. 0
Puan ver:
uses wincrt;
  var
  adres,ad,sad:string;
  etel,ctel:string;
  sec:longint;
  dd:text;
  ch:char;


procedure sor;
begin
ch:='e';
repeat

clrscr;
    write('adi   : ');readln(ad);
    write('soyadi: ');readln(sad);
    write('Adres : ');readln(adres);
    write('Ev telefonu : ');readln(etel);
    write('Cep telefonu : ');readln(ctel);
    
    writeln(dd,ad);
    writeln(dd,sad);
    writeln(dd,adres);

    writeln(dd,etel);
    writeln(dd,ctel);
    writeln(dd,adres);
    write('Devam edecek misiniz : ');
    ch:=readkey;
  until ch in['H','h'];

end;

procedure ekle;
begin
  {$I-}
  append(dd);
  {$I+}
  if IoResult<>0 then rewrite(dd);
  sor;

end;


procedure oku;
begin
  {$I-}
  reset(dd);
  {$I+}
  if ioresult <>0 then exit;

  clrscr;
  while not eof(dd) do
   begin

    readln(dd,ad);
    readln(dd,sad);
    readln(dd,adres);

    readln(dd,etel);
    readln(dd,ctel);
    readln(dd,adres);

writeln(ad:10,  sad:10,adres:25 ,etel:8,      ctel:8);
   end;
  close(dd);
  readln;

end;


procedure duzelt;
var
  dg:text;
  say,etel,ctel,etel1,ctel1:integer;
  ad1,sad1,ad2,sad2:string;
begin
  clrscr;
  write('Düzeltilecek  ad   : '); readln(ad1);
  write('Düzeltilecek soyad : '); readln(sad1);
  

  {$I-} reset(dd); {$I+}
  if ioresult <>0 then exit;
  assign(dg,'c:\bil1\gecici.txt');
  rewrite(dg);
  say:=0;
  while not eof(dd) do
    begin
     readln(dd,ad);
     readln(dd,sad);
     readln(dd,etel);
     readln(dd,ctel);
     if (ad<>ad1)or(sad<>sad1) then
       begin
        writeln(dg,ad);
        writeln(dg,sad);
        writeln(dg,etel1);
        writeln(dg,ctel1);
       end
       else
        begin
         write('Yeni  ad   : '); readln(ad2);
         write('Yeni soyad : '); readln(sad2);
         write('Yeni ev telefonu : '); readln(etel1);
         write('yeni cep telefonu: '); readln(ctel1);
         writeln(dg,ad2);
         writeln(dg,sad2);
         writeln(dg,etel1);
         writeln(dg,ctel1);
         say:=say+1;
        end;
    end;
  close(dd);
  close(dg);
  erase(dd);
  rename(dg,'c:\bil1\sinav.txt');
  gotoxy(50,24); writeln(say,' adet kayit düzeltildi');
  readln;
end;


procedure sil;
var
 ad1,sad1:string;
 dg:text;
 say:integer;
begin
  clrscr;
  write('Silinecek ad   : '); readln(ad1);
  write('Silinece soyad : '); readln(sad1);
  {$I-} reset(dd); {$I+}
  if ioresult <>0 then exit;
  assign(dg,'c:\bil1\gecici.txt');
  rewrite(dg);
  say:=0;
  while not eof(dd) do
    begin
     readln(dd,ad);
     readln(dd,sad);
     readln(dd,etel);
     readln(dd,ctel);
     readln(dd,adres);

     if (ad<>ad1)or(sad<>sad1) then
       begin
        writeln(dg,ad);
        writeln(dg,sad);
        writeln(dg,etel);
        writeln(dg,ctel);
        writeln(dg,adres);
       end
       else say:=say+1;

    end;

  close(dd);
  close(dg);
  erase(dd);
  rename(dg,'c:\bil1\sinav.txt');
  gotoxy(50,24); writeln(say,' adet kayıt silindi');
  readln;

end;



procedure ekran;
begin
  clrscr;
  gotoxy(21,2);write('________________________________________');
  gotoxy(21,3);write('TELEFON REHBERI VER.2.2  19,03,2005 KTU');
  gotoxy(21,4);write('________________________________________');
  gotoxy(21,7);write('_______________MENÜ_____________________');

gotoxy(30,9);write('_____________');
  gotoxy(33,10);write('Ekle  : 1');
gotoxy(30,11);write('_____________');

gotoxy(30,13);write('_____________');
  gotoxy(33,14);write('Oku   : 2');
gotoxy(30,15);write('_____________');

gotoxy(30,17);write('_____________');
  gotoxy(33,18);write('Sil   : 3');
gotoxy(30,19);write('_____________');

gotoxy(30,21);write('_____________');
  gotoxy(33,22);write('Düzelt: 4');
gotoxy(30,23);write('_____________');

gotoxy(30,25);write('_____________');
  gotoxy(30,26);write('Çikis : 9');
gotoxy(30,27);write('___________');

  gotoxy(29,28);write('Seçiminiz : ');

  readln(sec);
  case sec of
    1:ekle;
    2:oku;
    3:sil;
    4:duzelt;
  end;
end;


Begin
  assign(dd,'c:\bil1\sinav.txt');
  sec:=0;
  repeat
    ekran;
  until sec=9;
  close(dd);
End.


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.