function repls(str, s1, s2 : string) : string;
var
p,len1 : integer;
begin
len1 := length(s1);
repeat
p := pos(str,s1);
if (p<0) then break;
str := copy(str,0,p) + s2 + copy(str,p+len1,length(str));
until false;
repls := str;
end;
var
i : integer;
s : string;
begin
s := repls('4501234567890123456789454','45','abcdef');
showForm;
i := formAddString('>> '+s);
repeat until false;
end.