Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing comma delimited string
Message
De
23/11/2001 16:53:57
 
 
À
23/11/2001 16:09:56
Ron Neumann
Wausau Financial Systems
Mosinee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00585228
Message ID:
00585250
Vues:
25
Ron,

FWIW, here's an equivalent of ALINES() for VFP5:
LPARAMETERS taArray, tcString, tcDelimiter
LOCAL lcString, lnElements, i, lnPos

lcString   = tcString+tcDelimiter
lnElements = OCCURS(tcDelimiter, lcString)

FOR i = 1 TO lnElements
	lnPos = AT(tcDelimiter, lcString)
	DIMENSION taArray[i]
	taArray[i] = SUBSTR(lcString, 1, lnPos-1)
	lcString = SUBSTR(lcString, lnPos+1)
ENDFOR

RETURN lnElements
HTH
>I need to parse a comma delimited string in VFP 5.0. Since I can't use ALINES() in 5.0, what would be the best way to parse this string.
>
>"111111,222,333"
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform