Replace List Item

88 views
Skip to first unread message

L eveni

unread,
Jul 13, 2015, 7:15:50 AM7/13/15
to mitappinv...@googlegroups.com

Hi,

I have a TinyDB and in each tag of the TinyDB I have a list.

Each list has 3 items, each indexed as 1, 2 and 3.
I want to change the 3rd item, index 3.

So I have done the following


So I want to now save the change in the TinyDB

and have added a storeValue command as follows.

But i can't figure our how to get the valuetoStore variable.
Any ideas?

Thanks.


 



Taifun

unread,
Jul 13, 2015, 9:11:12 AM7/13/15
to mitappinv...@googlegroups.com
read the list form TinyDB and assign it to a variable, then replace the 3rd item and use TinyDB.StoreValue to store the variable in TinyDB

it might be easier to use a list of lists and store it in only one tag in TinyDB

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

L eveni

unread,
Jul 13, 2015, 9:38:12 AM7/13/15
to mitappinv...@googlegroups.com
I can already do what I want to do by replacing the whole list. That is, I make a new list with the 3 values and point the tag to the new list. 
But I want to do it a cleaner way.
If you could show me what you mean by actually making an example and copying it and pasting it here, then I would believe what you are saying is true.
But until then, you have not given an answer to the question.
Message has been deleted

Taifun

unread,
Jul 13, 2015, 1:53:05 PM7/13/15
to mitappinv...@googlegroups.com
see my answer in your Stackoverflow thread here http://stackoverflow.com/a/31390160/1545993
Taifun

L eveni

unread,
Jul 13, 2015, 7:07:52 PM7/13/15
to mitappinv...@googlegroups.com
You answer is 100% correct! good on you taifun.
Reply all
Reply to author
Forward
0 new messages