Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing using AT() and OCCURS()
Message
From
17/03/2004 17:00:13
 
 
To
17/03/2004 16:57:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00887289
Message ID:
00887291
Views:
14
This message has been marked as the solution to the initial question of the thread.
>I have values in a field like the following:
>
>record#1 aaaaaa.ccccccccc.dddddddd.gggggggg
>record#2 aaaaaa
>record#3 bbbbbbbb.aaaa
>record#4 xxxxx.mmmmmmmmmmmm.kk
>
>What I have to do is strip out all of the values on all sides of the '.' in the field so that I end up with the following (based on record#1 in the table above):
>
>value1 = 'aaaaaa'
>value2 = 'ccccccccc'
>value3 = 'dddddddd'
>value4 = 'gggggggg'
>
>So far I only have the below:
>
>*--I know that the number of values is always 1 greater than the number of
>*--'.' in the field i.e. xxx.xxx.xxx = 3 values
>fieldstack = OCCURS('.',acordfrm.field) + 1
>m.line=''
>FOR i = 1 TO fieldstack
>   IF fieldstack = 1 && only one value this works fine
>      m.line = acordfrm.field
>   ELSE  && get each value
>      IF i = 1  && get the first value this works fine
>         m.line = m.line + LEFT(acordfrm.field,AT(".",acordfrm.field)-1)
>      ELSE
>         *--Here I am stuck how to grab all others 2 - total
>      ENDIF
>   ENDIF
>ENDFOR		
>
>
>Any ideas appreciated!
>
>Tracy

You could use ALINES if you don't have VFP 8 where you can pass in cParseChar you could do
=ALINES(la_values, STRTRAN(ALLTRIM(field), '.',CHR(13))
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform