>>>m.ReplaceWith = '' >>>m.PrefixSearchString = [ MR MRS MS MISS DR PROF SIR MASTER REV REVERAND ETC ] >>>FOR x = 1 TO GETWORDCOUNT( m.PrefixSearchString ) >>> m.LookFor = [ ]+ALLTRIM(UPPER(GETWORDNUM(m.PrefixSearchString,x)))+[ ] >>> tcName = STRTRAN([ ]+UPPER(tcName)+[ ],m.LookFor,m.ReplaceWith) >>>ENDFOR >>>>>
>m.ReplaceWith = '' >m.PrefixSearchString = [ MR MRS MS MISS DR PROF SIR MASTER REV REVERAND ETC ] >m.lcNewName = [] >FOR x = 1 TO GETWORDCOUNT( m.PrefixSearchString ) > m.LookFor = ALLTRIM(UPPER(GETWORDNUM(m.PrefixSearchString,x)))+[ ] > lnAt = AT(m.LookFor,UPPER(tcName)+[ ]) # 0 > DO WHILE lnAt # 0 > m.lcNewName = LEFT(tcName, lnAt-1) + m.LookFor + SUBSTR(m.tcName, lnAt+LEN(m.LookFor)) > tcName = SUBSTR(m.tcName, lnAt+LEN(m.LookFor)) > lnAt = AT(m.LookFor,UPPER(tcName)+[ ]) # 0 > ENDDO >ENDFOR >tcName = IIF(EMPTY(m.lcNewName),m.tcName, m.lcNewName) >>That is NOT tested at all.