Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delimited string manipulation
Message
From
30/10/2003 14:52:32
 
 
To
30/10/2003 14:35:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00844670
Message ID:
00844686
Views:
19
>I have a very long comma delimited string. I want to pull that data into a table. I was wondering what the easiest way to do it may be.
>
>The string looks something like this "a,b,a,b,a,b,a,b" etc.....
>where a is a measuerment like ".45032" and b is a gage number like "01"
>
>I was thinking of Doing a strtofile() then an append from file delimited. but that seems a little cumbersome. Does anyone know of a better way?

This works with VFP6, VFP7 and above have additional parameters on ALINES you can use.
* aInfo[x,2]
*      [x,1] = measurement
*      [x,2] = gage
*
* Convert comma separated list into array
*
cInfoList = ".45032,01,.12345,02"
ALINES(aInfo,STRTRAN(cInfoList,",",CHR(13)+CHR(10)))
DIMENSION aInfo[ALEN(aInfo,1)/2,2]	&& Make it a 2 dimensional array again
Whoops, forgot the part about the table.

APPEND FROM ARRAY aInfo
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform