>Hi Erik!
>
>>>Meel, dhr. H.J. van|Posthumus, dhr. B.J.
>
>>OriginalString = "Meel, dhr. H.J. van|Posthumus, dhr. B.J."
>>LeftPortion = LEFT(x, ATC("|", x)-1)
>>RightPortion = SUBSTR(x, ATC("|", x)+1)
>
>Thanks alot for the answer! It works (didn't know the ATC() command :-))!! But. With textstrings which have the | in them it works fine. In my table it doesn't seem to work. I seems to be a RETURN code or something. Because if I type ?table.fieldname in the commandprompt it will show:
>
>Meel, dhr. H.J. van
>Posthumus, dhr. B.J.
>
>Instead of the | sign. Because if I make a variable like:
>
>OriginalString = "Meel, dhr. H.J. van|Posthumus, dhr. B.J."
>
>And then ?Originalstring then I get a nice print of:
>
>Meel, dhr. H.J. van|Posthumus, dhr. B.J.
>
>So in other words I need to specify the return sign somehow. In C it's /n but what is it in FoxPro?
>
>Thanks!
Hi Michel,
PMFJI, but it's probably CHR(13). Another way to do this is to use the Foxtools functions Words() and WordNum() with a technique similar to:
lnlast = Words(OriginalString, CHR(13))
FOR lni = 1 TO lnlast
lcsubstring = WordNum(OriginalString, CHR(13))
NEXT
Of course, don't forget to SET LIBRARY TO FOXTOOLS, prior to trying the above.
hth,
George
Ubi caritas et amor, deus ibi est