I am currently storing and loading using ajax various text files for my project. The format of the text file in this example is as follows
Text 123 - Text 456;
Text 789 - Text 10112;
So each line has a - and a ; as a delimiter , the - allows for the two texts value to be split out and the ; is for the end of that line. The | is a record separator . So I load this format into the array using the | to store each record into each cell of the array.
My problem is trying to get the text before and after the - . On the first line this works :
Textobject1.Text = trim(tokenat(array.at(counterpos),0,"-"))
Textobject2.Text = trim(tokenat(array.at(counterpos),1,"-"))
But when I try and use this logic for the second line :
Textobject2.Text = trim(tokenat(array.at(counterpos),2,"-"))
Textobject3.Text = trim(tokenat(array.at(counterpos),3,"-"))
Textobject2 does not equal the value before the - but the value afterwards and textobject3 shows the value from the next line (which is not here in this example).
My reason for holding the data in this way is I am storing each type of language verb per record and then the various definitions of that verb e.g. I am , they are etc on each line.
Any help to solve this would be appreciated
** EDIT **
Still struggling to get this to work so if I am using tokenat incorrectly or if there is another/better way of doing this I would appreciate if someone could advise on that. Not sure if this is any clue to the problem but the file is loaded via an included event sheet and that sheet then calls the function from the original sheet that called it and that the file is saved in a UTF-8 format to preserve the accents for the language.