Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Split, Conquer and Destroy!!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01006370
Message ID:
01007692
Vues:
20
Hi Tommy,

Thre are many ways to do this; here is one of them.

lcstring = '510,832,9953,21,3348'

You could use the GETWORDNUM() function and specify that the "," is the delimiter. For example here is how you get the values one at a time.

'510' = GETWORDNUM(lcstring,1,',')
'832' = GETWORDNUM(lcstring,2,',')

Here is some code to get them all and put them into an array

local lnwct
lnwct = GETWORDCOUNT(lcstring,',')
dimension myarray[lnwct]
for i = 1 to lnwct
myarray[i] = GETWORDNUM(lcstring,i,',')
endfor
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform