StrRepl: Orig = ARG(1) Oldtxt = ARG(2) Newtxt = ARG(3) Newstr = '' Work = Orig Do while POS(Oldtxt,Work) > 0 Newstr = Newstr||SUBSTR(Work,1,pos(Oldtxt,Work)-1)||Newtxt Work= SUBSTR(Work,pos(Oldtxt,Work)+LENGTH(Oldtxt)) end Newstr = Newstr||SUBSTR(Work,1) return Newstr