Table Row count question
Hello,
maybe someone has a hint on how to archive this:
I want to display the amount of rows in a table.
I imagine something like "count rows in table X where column 1 is NOT 0"
The thing is, i have an empty Table with 50 Rows, where column a is integer. So default value there is 0. After i parse a JSON from my Server, sometimes it adds several Lines of Datas where the first column is a unique ID. The amount of received rows varies every time. So all i need to know now is how do i count the rows, that actually have an value greater then 0 in the first column and display this number?
I´m sure it´s a quiet simple thing, but i just can´t figure it out lol...
I tried the loop over table and created an integer game attribute where i wanted to add "+1" for every loop where it finds a row that has above mentioned condition... but somehow it won't do the job, as i can't figure out how to add those criteria to the loop behaviour....
Any hint would be much appreciated...
Thank you
Comments
@3DMA, use the tableSearch function to give you the row index of the first 0 value.
If the result is 0 then the whole table is full.
If the result is 1 the the table is empty.
Otherwise the number of rows is the result-1.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thanx a lot @Hopscotch, i didn´t think about this approach :-)
Sometimes you just focus too much into a certain problem that you need someone else's opinion or just have to step back to see the bigger thing.
Thank you again :-)
Uhm... how to close a discussion or mark it as "answered"?
My pleasure @3DMA, and I know the feeling
Regarding marking as "Answered" I am not sure, maybe the thread has to have been opened as a question.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com