home *** CD-ROM | disk | FTP | other *** search
-
- procedure replace_string( var line: longstring; oldstr, newstr: longstring);
- (* perform string replacement if possible *)
- var
- k: integer;
- max: integer;
- begin
- max := 10;
- k := pos(oldstr,line);
- while (k <> 0) and (max > 0) do
- begin
- line := copy(line,1,k-1) + newstr +
- copy(line,k+length(oldstr),255);
- k := pos(oldstr,line);
- dec(max);
- end;
- end;
-
-