Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement