I am copying data from a foxpro table to a text file along with the memo fields data in the table.
The problem I have is there are several ASCII characters within the memo field which I want to remove, such as a Capital A Tilde - Ã, Small a Tilde - ã, Capital AE ligature - Æ.
It appears that the contents of the memo field were pasted in from some other application along with these characters.
With this code:
<code>
#DEFINE Atilde CHR(195)
lnDelChar=OCCURS(Atilde,lcMemo)
lcMemo=STRTRAN(lcMemo,Atilde,'')
</code>
I can remove the Capital A tilde but I need to search the entire memo field for several more ASCII characters before the contents are written to the text file. Any suggestions on how to best proceed.
I have attached some of the code where the memo field processing occurs.
<code>
CASE lcType = 'M' && Process the Memo Fields
lnMemoLines = MEMLINES(EVALUATE(laGetFields(lnCount,1)))
FOR lnLoop = 1 TO lnMemoLines
IF lnLoop < lnMemoLines
#DEFINE Atilde CHR(195)
lnDelChar=OCCURS(Atilde,lcMemo)
lcMemo=STRTRAN(lcMemo,Atilde,'')
lcMemo = lcMemo + ;
ALLTRIM(MLINE(EVALUATE(laGetFields(lnCount, 1)), ;
lnLoop)) + ' '
ELSE
lcMemo = lcMemo + ;
ALLTRIM(MLINE(EVALUATE(laGetFields(lnCount, 1)), ;
lnLoop))
ENDIF
ENDfor
lcString = lcMemo
lcMemo = ''
</code>
The problem I have is there are several ASCII characters within the memo field which I want to remove, such as a Capital A Tilde - Ã, Small a Tilde - ã, Capital AE ligature - Æ.
It appears that the contents of the memo field were pasted in from some other application along with these characters.
With this code:
<code>
#DEFINE Atilde CHR(195)
lnDelChar=OCCURS(Atilde,lcMemo)
lcMemo=STRTRAN(lcMemo,Atilde,'')
</code>
I can remove the Capital A tilde but I need to search the entire memo field for several more ASCII characters before the contents are written to the text file. Any suggestions on how to best proceed.
I have attached some of the code where the memo field processing occurs.
<code>
CASE lcType = 'M' && Process the Memo Fields
lnMemoLines = MEMLINES(EVALUATE(laGetFields(lnCount,1)))
FOR lnLoop = 1 TO lnMemoLines
IF lnLoop < lnMemoLines
#DEFINE Atilde CHR(195)
lnDelChar=OCCURS(Atilde,lcMemo)
lcMemo=STRTRAN(lcMemo,Atilde,'')
lcMemo = lcMemo + ;
ALLTRIM(MLINE(EVALUATE(laGetFields(lnCount, 1)), ;
lnLoop)) + ' '
ELSE
lcMemo = lcMemo + ;
ALLTRIM(MLINE(EVALUATE(laGetFields(lnCount, 1)), ;
lnLoop))
ENDIF
ENDfor
lcString = lcMemo
lcMemo = ''
</code>