Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slice a string into array
Message
 
To
13/07/2010 16:35:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01472400
Message ID:
01472416
Views:
63
Thanks Alines works perfect!

>>Hi all,
>>
>>I want to slice a string into an array: 90.80.67.30. ---> aVariable[1] = 90, aVariable[2] = 80, Variable[3] = 67, aVariable[4] = 30
>>I thought there was a foxpro function for it, that I forgot.
>>
>>Thanks beforehand.
>
>The built-in function is alines().
>
>Here is a sample which I just tested in the command window:
>
>
>ALINES(MyArray, "10.1.0.15", 0, ".")
>? MyArray(1)
>? MyArray(2)
>? MyArray(3)
>? MyArray(4)
>
>
>Note that the fourth parameter (character delimiter) works in Visual FoxPro 9, but not in Visual FoxPro 6. I don't know exactly in what version it was introduced, since I didn't do any serious work in versions 7 and 8. For older versions, you can first do a replacement with strtrans().
Zakaria al Azhar
My blog on Actuaris.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform