We use this:
*-----
function onespace
*
* Leaves only one space between the words of a string, and optionnaly trims the string
*
lparameters lcString, lnLen
lcString = alltrim(lcString)
do while ' ' $ lcString
lcString = strtran(lcString, ' ', ' ')
enddo
* Trims the string if necessary
if type('lnLen') = 'N' and lnLen > 0
lcString = padr(lcString, lnLen)
endif
return lcString
*-----
Gensoft Sàrl
Christian Carron