Hello everyone, my name is Massy and this is my first post in this forum... so first of all I would like to introduce my self: I am a developer from Italy, I'm developing apps for iOS since some years and now I would like to make some apps for Android market.
I'm new at b4a so please... be patient and try to deal with me...
I need to create a multidimensional array from a text file, I already know how to load the text file but now I need to know how to create a multidimensional array with it.
My text is on muliple lines and the objects are divided by the key "|"...
so for example my text can be like this:
1|this is the first line|this is the end of the first line
2|this is the second line|this is the end of the second line
3|this is the third line|this is the end of the third line
.... and so on...
Now I need to create an array that has all the lines and for every line all the objects separated by the | symbols...
In objective c for this I have to create an array inside an array... as it has not the multidimensional arrays... and it is something like this:
NSString *list = myFileContent; //here I create a string variable with the content of my text file
allLinesArray = [list componentsSeparatedByString: @"\n"]; //here I create an array with every line of the text.... note componentsSeparatedByString : @"\n" with this it make every object of the array with a line of the text...
NSArray *oneLine;
allElementsArray= [NSMutableArray arrayWithCapacity: [allLinesArray count]];
int index;
//loop through each line and create an array of elements
for (index = 0; index < [allLinesArray count]; index++)
{
oneLine = [[allLinesArray objectAtIndex: index] componentsSeparatedByString: @"|"]; //here I select every object that is after a |
[allElementsArray addObject: oneLine]; //I add the array created in a new array
}
How can I do this in b4a? I hope my english was good enough to let you understand my needs...
Thanks for any help
Peace
Massy