uses crt;
var
f,f1:text;
ch:char;
st:array [1..15] of string;
tr,kl:string;
min,max,k,a,i,p,b:byte;
{$i-}
procedure okno;
begin
textbackground(0);
clrscr;
textbackground(1);
window(13,6,75,25);
clrscr;
end;
procedure save;
begin
write('vvedite imia faila:');
readln(asd);
assign(f, asd);
rewrite(f);
if ioresult<>0 then
write('fail ne naiden')
else begin
for p:=1 to i do
begin
writeln(f, st[p]);
end;
close(F);
write('fail uspeshno sohranen');
end;
readln;
end;
procedure ydal;
begin
write('vvedite imia faila:');
readln(asd);
write('udalit fail',asd,'? (Y)\N');
ch:=readkey;
if (ch='y')or(ch='Y') then
begin
Assign(f, asd);
reset (f);
if ioresult<>0 then
begin
clrscr;
write('fail ne naiden');
end
else begin close(f);
erase(f);
clrscr;textcolor(15);
write('fail udalen!!!');
end;
end;
readln;
end;
procedure dobav;
begin
if i<=15 then
begin
okno;
write('vvedite imia faila:');
readln(asd);
textbackground(1);
window(13,6,75,20);
clrscr;
i:=i+1;
readln(st[i]);
Assign(f, 'q');
append(f);
if ioresult<>0 then
begin okno;
write('fail ne naiden');
end
else begin
writeln(f, st[i]);
close(F);
okno;
write('fail uspeshno sohranen');
end;
readln;
end;
end;
procedure open;
begin
okno;
write('vvedite imia faila:');
readln(asd);
assign(f, 'q');
reset(f);
if ioresult<>0 then
begin
write('fail ne naiden');
end;
textbackground(1);
window(13,6,75,20);
clrscr;
for p:= 1 to i do
begin
readln(f,st[p]);
writeln(st[p],' ');
end;
readln;
close(f);
end;
procedure as;
begin
okno;
write('vvedite imia faila:');
readln(asd);
assign(f, asd);
append(f);
assign(f1,'w' );
rewrite(f1);
if ioresult<>0 then
begin
write('fail ne naiden');
end;
textbackground(1);
window(13,6,75,20);
clrscr;
writeln('stroka dlia ydalenia');
max:=i;
readln(p);
for i:=1 to max do
begin
if i<>p then
writeln(f1,st[i]);
end;
close(f);
close(f1);
asd:='w';
assign(f,asd);
reset(f);
p:=max-1;
for i:= 1 to p do
begin
readln(f,st[i]);
writeln(st[i],' ');
end;
readln;
close(f);
end;
procedure stroka;
begin
okno;
write('vvedite imia faila:');
readln(asd);
assign(f, asd);
reset(f);
if ioresult<>0 then
begin
write('fail ne naiden');
end;
for p:=1 to i do
begin
a:=length(st[p]);
if p=1 then
begin
tr:=st[p];
kl:=st[p];
min:=a;
max:=a;
end;
if a>=max then
begin
max:=a;
tr:=st[p];
end;
if a<=min then
begin
min:=a;
kl:=st[p];
end;
end;
writeln('samaia dlinnaia stroka ',tr);
writeln('samaia korotkaia stroka ',kl);
readln;
end;
begin
okno;
write('vvedite stroku ');
i:=1;
readln(st[i]);
save;
repeat
okno;
ch:=readkey;
if ch=#49 then
open;
if ch=#50 then
dobav;
if ch=#51 then
ydal;
if ch=#52 then
stroka;
if ch=#53 then
as;
until ch=#27;
end.
вот что вышло почти моими усилиями))) пот имено тот 3 пункт ну не как он не катит((((( помогите а я вот тут не много догнать в этом тектсте не могу где редактирование файла!? что-то не работает((( помогите пиз!