Hi There!
I need to create a simple app that reads 2 fields on screen: Product ID, Quantity
and stores these pairs "somewhere".
Then at the end of the process (this could be 3000 scanned items for an inventory) I need to dump all the records to a CSV file. Also I need a button to delete last entry so there should be an easy to use function for this on whatever method is picked.
Should I start creating a file and just appending label1.text+","+label2.text?
Or should I use a TinyDB with tags using incremental numbers and letter for each field?
Like tag "1A" contains product_1, tag "1B" contains Amount_1.
Tag "2A" contains product_2, tag "2B" contains Amount_2...
tag 3000A...tag 3000B....
And then build the CSV file with all the created tags?
Or will it be better to forget about DB's and start directly with real local files? I fear that dea,ling with removing the last record might be complex, but then dumping the final file wiill be immediate
I would add to a list, save that list to a tinydb tag, then eventually export the list from the tinydb to a csv file when you need the csv file updated. Lists/tinydb will work much faster, save out to file as often as you feel is necessary ...
So the "value" field in the DB would be a list? Im having issues with that, complaining about wrong arguments...
Im probably missing something I can't find...
I had already checked that and in some way used part of that sample code, but I ALWAYS get that error, no matter what I changed. But now I simplified it and still get the same error:
Can't I just biuld the list and assign it to the stored value without having to store it previously in a variable? This is how Im doing it in the last screenshot I pasted. But still not working
If you want to skip using the list, and just work with the tinydb, use the index generator procedure to create your tags with a list of the data. Button1 saves a new entry, Button2 deletes the last entry