Hi there, I've initialized a variable sr_no to 1 and have been trying to assign its value to a ListView element and then increment it everytime the code executes.
But upon execution, it gives an error.
Can anyone help me with this..?
Hi there, I've initialized a variable sr_no to 1 and have been trying to assign its value to a ListView element and then increment it everytime the code executes.
But upon execution, it gives an error.
Can anyone help me with this..?
Please provide more infos. How do you assign value to a ListView element ? What error do you get ? Post a screenshot of the blocks that you use
Ok and the blocks you use to assign value to a ListView element ?
So actually I'm trying to insert values from TinyDB to a ListView, which is doing fine, but for serial number, I wish to generate values equal to the no. of times the loop runs, so I initialized to 1 and increment it everytime the loop runs.
So there's no direct approach to convert a number into a string..?
First of all your blocks are wrong. I do not see anywhere tinydb
The TinyDB code works fine, fetching data one by one & inserting it to the ListView, but the value which I have been generating locally, giving me a hard time.
I didn't post all blocks of code bcoz it'd be unnecessary I think & not be easily readable.
Perhaps using a listview is not the best approach:
I decided to store the serial no. in the TinyDB itself & fetch it into the ListView, pfa
But if you notice, that I'm trying to build a leaderboard which should be sorted as per the last column (score) in descending order and the entry at the top should be labeled Sr. No. 1.
Is sorting possible with the approach you've suggested..?
List Sorting On App Inventor using Blocks explains how a List can be sorted.
Also look at the community discussions with respect to leader board and you might find an alternative to your present leaderboard.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.