Показать сообщение отдельно
  #2  
Старый 21.02.2007, 13:18
vinni vinni вне форума
Начинающий
 
Регистрация: 26.01.2006
Сообщения: 135
Репутация: 10
По умолчанию

все, разобрался:

procedure Replace(FileName:string);
var
f: file;
l: Longint;
oldstring, newstring, s: string;
begin
oldstring := '_NullFlags';
newstring := '_NullFlags.C';

s := oldstring;
AssignFile(f, FileName);
Reset(f, 1);
for l := 0 to FileSize(f) - Length(oldstring) - 1 do
begin
Application.ProcessMessages;
Seek(f, l);
BlockRead(f, oldstring[1], Length(oldstring));
if oldstring = s then
begin
Seek(f, l);
BlockWrite(f, newstring[1], Length(newstring));
ShowMessage('String successfully replaced!');
end;
Application.ProcessMessages;
end;
CloseFile(f);
end;
Ответить с цитированием