I have an array with a width of 440 and a height of 5. It looks like this:
[score, text1, text2, category, id]
For my app I need to sort the array by score but also filter it by whichever category the user chooses. To accomplish this I created another array and set it to have the same dimensions. Then I iterate through the array that has my data and copy ONLY the rows that match the chosen category into the new array. That part works great.
Unfortunately, since both arrays have the same dimensions, my new filtered array isn't as big and so has a bunch of "0,0,0,0" lines at the end.
How do I fix this? I suppose I could set all the "0" scores to a really high number so they would get sorted to the bottom, but there has to be a more elegant solution. Can I search through and delete the "0,0,0,0" rows?
Not sure if it will be useful but here's a picture of my function:
NOTE: On 'Start of layout' I load all my data into "array2" and this function copies everything that matches category "x" into the original array ("array")