Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is that command that returns words from text?
Message
From
22/01/2008 01:49:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
22/01/2008 01:44:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01283877
Message ID:
01283914
Views:
21
>Sooner or later lcRgb6 will actually be RGB3
>
lcRgb6="RGB(1,2,3,4,5,6)"
>dimension a[6]
>a=0
>for i=2 to getwordcount(m.lcRgb6, "(),")
>   a[i]=val(getwordnum(m.lcRgb6, i, "(),"))
>ENDFOR
>DISPLAY MEMORY LIKE a
>
>if really only a string "RGB(x,y,z)" is needed and lcRGB6 is always well formed,
>lcRGB1 = Alltrim(Left(m.lcRGB6, at(m.lcRGB6, ",", 3)-1) + ")" )
>lcRGB2 = "RGB(" + Alltrim(Subst(m.lcRGB6, at(m.lcRGB6, ",", 3)+1) )
>should work faster...

Yes, it would, but Jay said he didn't like the idea of getting into some hardly readable substr(... at(... )), and it seems he wanted to do it with getword*() but it didn't work. So this was just to show that it can be done that way - and now he has both options and can figure out why it didn't work the first time.

Though, this being Fox, I'm positive it can be done in another way... yes :)
lcR6="RGB(1,2,3,4,5,6)"
lcR6=chrtran(lcR6, "(),", chr(13))
alines(a, lcR6)
Just kidding :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform