Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Separate a group of number
Message
From
17/05/2019 00:13:04
 
 
To
14/05/2019 09:46:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01668589
Message ID:
01668676
Views:
54
it works like a charm
Thank you so much

Jerry Yang


>>what is the easiest way to separate a group of numbers into fields?
>>this is for disc% (up to 8 levels)
>>
>>eg:
>>2+5+6+2+4+7+4
>>
>>into:
>>
>>disc[1]= 2
>>disc[2]= 5
>>disc[3]= 6
>>disc[4]= 2
>>disc[5]= 4
>>disc[6]= 7
>>disc[7]= 4
>>disc[8]= 0
>>
>>Thank you
>>
>>Jerry Yang
>
>Is this a .Net question or VFP?
>With .Net:
>
>
>string numbers = "2+5+6+2+4+7+4";
>var nums = numbers.Split('+')
>           .Select(n => int.Parse(n)); // .ToArray() if you will
>
>
>With VFP:
>
>Local numbers, ix
>numbers = "2+5+6+2+4+7+4"
>Local array laNums[Occurs('+',numbers)+1], laNumbers[1]
>For ix=1 to ALines(laNumbers,m.numbers,1+4,'+')
>	laNums[m.ix] = Val(laNumbers[m.ix])
>endfor
>
Previous
Reply
Map
View

Click here to load this message in the networking platform