Cose strane che mi capitano con add item list

Salve a tutti,
mi sta capitando da qualche giorno, una cosa strana in riferimento al componente add item to list..nel momento in cui vado ad inserire il contenuto di una textBox in una semplice variabile..mi da questo errore :thinking:
Saluti
Nicola

La cosa bella è che in un'altra mia app, add item list; funziona perfettamente :upside_down_face:

(putting on my mystic swami hat that lets me see invisible code)

Your bug is in the upper right, out of sight, where you load global DVD from TinyDB and
ask for a default value that is not an empty list but instead some piece of text.

1 Like

(adding the Time Machine attachment to my mystical swami hat and increasing its voltage)

At some time in the past, during the development of this app, you stored something in TinyDB under tag DVD that was not a list.

You fail to test the value returned from tag DVD using the 'is a list' block before you try to add items to that supposed list.

1 Like

Come è possibile che nonostante io dichiaro global DVD come una lista; Is a list mi dice invece che non è una lista? :thinking:

(I had to use Google translate for this)

How is it possible that although I declare global DVD as a list; Is a list instead tells me that it is not a list

Unlike other languages that restrict data values to the types declared for them, AI2 dynamically changes data types for variables when you assign data into them. So the init global value is only a starter value, until you come along and change the value of the variable.

Here is a foolproof TinyDB loading sequence to insure that you will always get a list from TinyDB:

ToDo.aia (7.2 KB)

1 Like

I'm studying the AIA file you sent me; but the strange thing is that I have been using the "add item to list" function in conjunction with the TinyDB component for 4 years, and everything has always been fine with variable declarations. Now, however, I discover that some of my apps that worked well 4 years ago and which I also included on the Play Store; if I try them now with the companion; I inevitably get this error: "Add item to list cannot accept the arguments", although I have declared the variables with "create empty list": thinking:

TinyDB in the Companion is a garbage pail that is rarely emptied.

It accumulates entries from all the apps that have been run using the Companion, until some one empties TinyDB.

P.S. Here are some utilities to dump TinyDB:
https://groups.google.com/g/mitappinventortest/c/vSTgVZAMnDE/m/0B4bvRhcCgAJ

Run one of them in the Companion.
(Hold your nose!)

2 Likes

@ABG Ho appena provato a cambiare il nome al mio tag, e adesso funziona tutto.
Saluti
Nicola

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.