Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing using AT() and OCCURS()
Message
From
17/03/2004 17:04:48
 
 
To
17/03/2004 17:00:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00887289
Message ID:
00887294
Views:
9
Sheesh, don't know where my mind is today! It worked like a charm!
Thanks!

>>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))
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform