var
st: string;
line: string;
F: file of char;
f_name: string;
s: string;
ch: char;
i: integer;
function h(st: string): integer;
Var
I,sum: integer;
Begin
For i:=0 to length(st) do
Sum := sum + ord(st[i]);
H:=sum mod 256;
end;
begin
writeln('введите имя файла');
readln(f_name);
assign(f,f_name);
reset(f);
s:='';
while (not eof(f)) do begin
read(f, ch);
repeat
s:=s+ch; //здесь выдает ошибку
until (ch=' ');
st:=s;
h(s);
writeln (h(s));
s:='';
end;
close(f);
end.
.