Hey Clickteamers! I was just hoping to get some help with a slight problem I'm having. The situation is as follows:
I have multiple String Parser Objects. They are each loaded with a CSV file. The files are rather long. 1600 values are contained in each one.
I have a NumbersList Object.
During a fast loop, I want to retrieve 4 values from each parser object. The values are at index 3, 35, 803 and 835. Then, create a list of the values in the NumbersList Object. I then want to sort them and return only the highest of the values (The one located at index 0 of the List when sorted) to a counter.
I can do this manually by going through all the String Parser Objects one at a time and saying, [add to list("parser object x", 3)] then the same for 35, 803 and 835. However, 16x4 equals 64. So that means 64 actions in a single line. This is a problem because in a later part of the program I'll be returning 22 values from each parser object. That would mean that I would require over 300 actions. Which to my knowledge is impossible.
That said, I tried many different ways to get these values in a shorter process.
First, I created a new counter and tried to use the Str$(counter value) command inside the object's name and then increment the counter each time a parser was checked. That looked something like this:
Val( listGetAt$( "String ParserGameFile "+Str$( value( "Counter" ) ), 3) )
This throws a syntax Error. Apparently, you can't place some kind of variable in the name of an object. I made sure the value in the counter matched a value of the string parser objects' names. I tried moving the ")" closers around and couldn't get it to work without a syntax error.
This got me thinking of the second idea. What about a spread value, or an alterable value? Problem is, String Parser Objects don't have the capacity to store AltValues and therefor you can't spread values upon them.
This in turn led me to my third and final effort which was to use the create a Qualifier to contain all parser objects. I thought this idea would do it, but it ended up failing as well. Just to be sure I created a temp counter and had it always track the number of items in the list (or list size). And after the loop, the list only contained 4 values. This told me that even though I was telling it to retrieve the value in the 3rd index position of Qualifier, it only went through one of them during the loop.
So, I'm at a point here where I can either A) try my luck at the manual method, adding countless actions to conditions or B) make 16 different conditions each time I need to retrieve the values, one for each of the parser objects. That way, I will only have 4 (or later 22) actions when getting values from the individual parsers.
I will do this if there is no other way. But it seems to me there MUST be some other way of doing this.
So in summary, I need to be able to make a numbers list containing the same index values from CSV files stored in 16 different String Parser Objects.
Any help would be appreciated.




Reply With Quote