On Thu, May 8, 2008 at 12:28 AM,  "Allen" wrote:
>
>  Something like (bear in mind the wine has flowed :)
>
>  Local retval, lText
>  Retval = ""
>  lText = strtran(lcIn,"[","["+chr(13+chr(10)
>  lText = strtran(lText,"]","]"+chr(13+chr(10)
>  For iicount = 1 to memlines(lText)
>         if left(mline(lText,iicount) <> "["
>                 retval = retval + mline(lText,iicount)
>         endif
>  Next iicount
>  Return retval
>
>  Allen
>
>  -----Original Message-----
>  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>  Behalf Of Alan Bourke
>  Sent: 07 May 2008 17:57
>  To: [EMAIL PROTECTED]
>  Subject: Re: VFP9 SP2: substring extraction
>
>  Well, shortest I can manage is:
>
>  lcIn = "Apples [some text]; oranges [some more text]; bananas [more text]"
>  lcOut = ""
>
>  lnLines = ALines(laFruits, lcIn, 9, ";")
>
>  For lnLoop = 1 To lnLines
>
>         lcOut = lcOut + Left(laFruits[lnLoop], Atc(" ", laFruits[lnLoop])-1)
>  + ";"
>
>  Endfor
>
>  ? lcOut
>
>
>
>  But I bet some Regular Expression maven can better it!
>  --

lcInput = "Apples [some text]; oranges [some more text]; bananas [more text]"
lnLines = ALines(laFruits, lcInput, 9, "]")

?

For Each lcLine In laFruits
        ?? GetWordNum( lcLine, 1, "[")
EndFor

Cheers,

G.


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to