Hello, I've been making a personal goal-setting app and it has been going mostly smoothly, I'm almost done with it, except for 1 major problem-I can set goals, I can complete them, but whenever I exit out of the app and come back in (With the dictionary supposedly loaded in from the TinyDB) I'm getting a select list item isn't compatible with not found whenever I try to find it again. Anyone have a clue as to what's happening?
maybe this:
and I think Using a number as dictionary's key is not a good idea.
Instead you can use list of Dictionaries.
Well, that didn't work. And I use numbers as the dictionary's keys because it lets me do stuff like a 'For each number' and have it go through the dictionary that way. While I could see having a list of dictionaries to be smart, I just find less hassle in doing it this way.
explain this more please.
What is item 1 of the piece of text 'not found '?
I caught a quick peek at your code, and I have to recommend a recent tutorial on how to deal with not found lookups ...
How to Deal with notfound from lookups
The operation select list item cannot accept the arguments: , ["not found"], [1].
In this case, it's the title of the goal-Which I have run into a list-picker by a list of elements so I can choose the goal by title.
If there is no value for that key in the dictionary, you are trying to select the first item from the text "not found"
To avoid the error, replace the text "not found" by a make a list block together with "not found" as first item
Taifun
Well, that avoids the error, but doesn't exactly fix the problem. The problem is that I'm getting 'not found' in the first place. If TinyDB was working, then I shouldn't be getting not found because the dictionary was working in this configuration before TinyDB. If TinyDB wasn't working, I'd expect an empty dictionary, which also hasn't happened, leaving me stuck somewhere in the middle.
Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
Okay, I do appreciate all of your guys advice, but none of it is actually about the problem I'm having. Yes, there might be ways to make it more efficient, to avoid an actual error message, etc., but I just want the app to work. I'm sorry if this comes off as rude, but I just see no progress being made.
(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
.
..
If you really want it ... I've been scolded by people when I do that normally, but if you're asking for it ...
EMILY.aia (4.7 MB)
To save duplicate effort in case any one else is studying this app, here's a fully expanded but otherwise untouched copy.
EMILY (1).aia (4.7 MB)
The blocks are readable on a small screen like a phone.
I am proceeding to study your data structure, and to see why it fails passing into and out of TinyDB.
You might have to switch to a list structure to preserve order, since dictionaries are sorted by key.
Here is proof that a dictionary with number keys will not survive a trip into and out of TinyDB:
Changing TinyDB to allow this should be regarded as a Millenia Goal.
Changing your code to use lists instead of dictionaries would be a shorter goal.
Thank you so much! It's weird that TinyDB just doesn't allow that, but I'm not one to judge it I guess.
(added to FAQ)
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.