Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is that command that returns words from text?
Message
De
22/01/2008 01:49:25
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
22/01/2008 01:44:31
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01283877
Message ID:
01283914
Vues:
22
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform