_WELCOMETO Radioland

Top50  











.




.








.














> > ( )

( )

: 2/3

rewrite(f);

end;

{-----------------------------------------------------------}

procedure Addrecord;

var rez:integer; ch:char;

begin

while rez<>1 do

begin

writeln(' , ');

readln(filename);

assign(f,filename);

reset(f);

rez:=IOResult;

if rez<>0 then

begin

writeln(' !');

writeln(' ?(Y/N)');

readln(ch);

if (ch='n') or (ch='N') then halt (0);

end;

end;

seek(f,filesize(f));

end;

{==========================================================}

procedure Inputfile;

var st:prokat;

k:char;

begin

repeat

writeln(' : ');

write(' : '); readln(st.Sname_Hozaina);

write(' :' ); readln(st.Name_Hozaina);

write(' :'); readln(st.markauto);

write(' :'); readln(st.model_auto);

write(' :'); readln(st.tip_kyzova);

write(' : '); readln(st.Nomer_auto);

write(':'); readln(st.region);

write(' : '); readln(st.God_vipyska);

write(': '); readln(st.color);

write(f,st);

write(' ? (Y/N)>');readln(k);

writeln;

until(k='n') or (k='N');

close(f);

end;

{=========================================================}

procedure redzap;

var

st:prokat;

filename,str:string;

Sname_Hozaina2,Name_Hozaina2:string[15];

markauto2:string[20];

model_auto2:string[20];

tip_kyzova2:string[20];

nomer_auto2:string[20];

region2:integer;

god_vipyska2:integer;

color2:string[20];

x:integer;

begin

writeln(' ');

readln(filename);

assign(f,filename);

reset(f);

with st do

begin write(' : ');readln(str);

x:=0;

while not eof(f) do

begin

read(f,st);

if st.Sname_Hozaina=str then

begin

writeln(' : ');

write(' : '); readln(st.Sname_Hozaina);

write(' : '); readln(st.Name_Hozaina);

write(' :'); readln(st.markauto);

write(' :'); readln(st.model_auto);

write(' :'); readln(st.tip_kyzova);

write(' :'); readln(st.nomer_auto);

write(':'); readln(st.region);

write(' :'); readln(st.god_vipyska);

write(': '); readln(st.color);

Sname_Hozaina2:=Sname_Hozaina; markauto2:=markauto;

Name_Hozaina2:=Name_Hozaina; color2:=color;

Nomer_auto2:=Nomer_auto; model_auto2:=model_auto;

God_vipyska2:=God_vipyska; tip_kyzova2:=tip_kyzova;

region2:=region;

seek(f,filepos(f)-1);

write(f,st); x:=1;

end; end;

close(f);

end;

if x=0 then begin writeln(' !');readln end;

end;

{==============================================================}

procedure Openfile;

var rez:integer;ch:char;

begin

while rez<>0 do

begin

writeln(' ');

readln(filename);

assign(f,filename);

reset(f);

rez:=IOResult;

if rez<>1 then

begin

writeln(' !');

writeln(' ? (Y/N)');

readln(ch);

if (ch='n') or (ch='N') then halt (0);

end;

end;

end;

{============================================================}

procedure Outputfile;

var st:prokat;k:char;

begin

writeln(' ? (Y/N)');

readln(k);

if (k='y') or (k='Y') then

while not eof(f) do

begin

read(f,st); clrscr;

writeln(' :',st.Sname_Hozaina);

writeln(' :',st.Name_Hozaina);

writeln(' :',st.markauto);

writeln(' :',st.model_auto);

writeln(' :',st.tip_kyzova);

writeln(' :',st.nomer_auto);

writeln(';',st.region);

writeln(' :',st.god_vipyska);

writeln(':',st.color);

writeln(' (enter)');

readln;

end;

close(f);

end;

{========================================================}

procedure Clearfile;

var st:prokat;

studtoout:string[20];

fo:file of prokat;

begin

writeln(' , ');

readln(filename);

assign(f,filename);reset(f);

assign(fo,'newfile.dat');rewrite(fo);

writeln(' , ');

readln(studtoout);

while not eof(f) do

begin

read(f,st);

if st.sname_Hozaina<>studtoout then write(fo,st);

end;

close(f);close(fo);

erase(f);

rename(fo,filename);

end;

{ }

Begin 11:clrscr;

writeln(' :');

writeln('1: ');

writeln('2: ');

writeln('3: ');

writeln('4: ');

writeln('5: ');

writeln('6: ');

readln(k);

case k of 1: begin Creatfile; Inputfile end;

2: begin Addrecord; Inputfile end;

3: redzap;

4: begin Openfile; Outputfile end;

5: Clearfile;

6: Halt;

else writeln('. .')