>Is there an obvious way to remove trailing carriage returns at the end of memo field - nasty in reports that display alltrimed memos. I have tried a substr() command replacing chr(13) with "" but this not working. Thank you in advance if someone knows the best way.
Denis,
You already have good suggestions. I'd like to add my .2 cents. Linefeeds in a memo are not just chr(13) but chr(13)+chr(10) (in rare circumstances any combination might occur). Also besides trailing, multiple linefeeds between paragraphs were a problem for me too. Worst these characters are not trimmable and 'T' formatting has no effect.
lcMemo = chrtran(myMemo,chr(13)+chr(10),chr(10))
do while occurs(chr(10)+chr(10),lcMemo)>0
lcMemo = strtran(lcMemo,chr(10)+chr(10),chr(10))
enddo
lcMemo = left(lcMemo,len(lcMemo)-iif(right(lcMemo,1)=chr(10),1,0))
Cetin