помогите плиз, у меня полдная муть получается , кроме процедур создания и удаления файла другие не работают,а процедура дополнения файла вообще не получается
вот моя прога:
uses dos,crt;
var
infile:text;
vibor:char;
procedure makefile;
var
i,maxn,m:integer;
begin
clrscr;
assign(infile,'c:\file');
rewrite(infile);
writeln('сколько вводится символов');
readln(maxn);
write(infile,maxn);
for i:=1 to maxn do
begin
read(m);
write(infile,m);
end;
close(infile);
end;
procedure chtenie;
var
i:integer;
a:array[1..100] of integer;
begin
assign(infile,'c:\file');
reset(infile);
for i:=1 to 5 do
while not(eof(infile)) do
begin
read(infile,a[i]);
writeln('k=',a[i]);
close(infile);
end;
end;
procedure pename;
var
newname:string;
begin
assign(infile,'C:\file');
reset(infile);
readln(newname);
rename(infile,newname);
close(infile);
end;
procedure udalenie;
begin
assign(infile,'c:\file');
reset(infile);
close(infile);
erase(infile);
end;
procedure found;
begin
assign(infile,'c:\file');
fsearch('file','c:\');
end;
begin
makefile;
writeln('созданный файл - c:\file');
writeln('переименовать-1;найти-2;дополнить-3;удалить-4;читиать-5 файл');
readln(vibor);
case vibor of
'1': pename;
'2': found;
'4': udalenie;
'5': chtenie;
end;
readln;
end.
теги...