>>>>
>>>>Done that yesterday <g> BTW, another little catch here - CHR(13)+CHR(10) in Memo fields should be replaced with CHR(10) to be properly shown in Excel.
>>>>
>>>
>>>I applied your suggestion of changing CHR(13)+CHR(10) to CHR(10) as following:
>>>
>>>
>>>replace MYMEMO with STRTRAN(MYMEMO,CHR(13)+CHR(10),CHR(10))
>>>
>>>
>>>but I still see the square brackets when looking at the data in the spreadsheet. Do you see anything wrong in my use above?
>>>
>>>Thank you.
>>
>>Here we use a special function, which is supposed to do the same:
>>
>>
>>LPARAMETERS tmMemo
>>local laLines[1], lnLines, i, lcString
>>
>>lnLines = ALINES(laLines, m.tmMemo, .t.)
>>DO CASE
>> CASE lnLines = 0
>> lcString = ''
>> CASE lnLines = 1
>> lcString = laLines[1]
>> OTHERWISE
>> lcString = ''
>> for i = 1 TO lnLines - 1
>> IF NOT EMPTY(laLines[i])
>> lcString = lcString + laLines[i] + CHR(10)
>> endif
>> ENDFOR
>> * Add the last line with no line feed.
>> lcString = lcString + laLines[lnLines]
>>ENDCASE
>>
>>return lcString
>>
>>Are you sure you're using Memo fields and not char fields?
>
>Yes, definitely Memo field. I also noticed that if I don't run the memo field through STRTRAN() I see 2 square brackets. After running memo field with STRTRAN() I see only 1 square bracket in the same places. So I presume that the second one is there for some other reason. I think I will let the customer look at it to see if I find this to be a problem.
>
>Thank you again for your help.
Try chrtran(myMemo, chr(13) + chr(10), chr(10))
I'm sorry for not catching it earlier. Your original code would only replace CRLF, not CHR(13) individually.
If it's not broken, fix it until it is.
My Blog