Issue in variable value from blocks

Hello !
I have an issue with the value of a varible passed from .initialize of a screen and a .taglist
(but from a procedure and a .taglist too)...
Here is the blocks

and here is the db

This is an example, don't worry about the meaning of the operations...
In .initialize I make a loop and set global tag to a value of lista list. First "due", then "tre" and last "uno".
In .taglist I read the value of tag and for tree times it is "uno".
No way to obtain the correct sequence "due", "tre" and "uno".
Someone give me an idea ?
Thanks !

Don't machine gun your tag list requests in a loop.

Instead copy your desired project bucket values to a temporary list, and ask for the first item's taglist.

When a taglist arrives, stash it appropriately, then remove item 1 from the temporary bucket list.
If the bucket list is non-empty, ask for the new first item's tag list.

That global tag variable is a mismatch for this situation.

Tanks for your reply.
I think I've understand but... you can show me some blocks ? :slight_smile:
Thanks very much

Please download and post each of those event block(s)/procedures here ...
(sample video)

so I can copy/paste into my Blocks Editor?

(or post .aia file)


Here is a reworked attempt, using a dictionary to cache bucket values...

bucket_list.aia (3.3 KB)

Since I don't have access to your test data, you will have to test.

Thanks ! I will try this solution.

Something is wrong...

I've never used the dictionaries...

This dictionary error is unexpected.

The error is apparently happening in the block that sets a key/value in the global variable cache_dict, which was created as an empty dictionary.
The three sockets in the set value for key block correspond to the three parameters [...],[...],[...] listed in the error message:

  • key: "due"
  • in dictionary: {} (JSON text representation of an empty dict)
  • to: ["Selezione", "secondo"]
    Those look reasonable for the 3 parameters to a request to add a key/value to a dictionary.
    Going back to the error message, something unusual in there:

The operation dictionary recursive set cannot accept the arguments: ...

Recursive is a Computer Science term applied to things that are applied to themselves to an indeterminate depth, like the definition of n factorial n! = n * (n-1)! where 1! = 1.

Reexamining my blocks, I missed an extra word "path" that rode along in my block to save a key/value in my dictionary. I was expecting the simpler version of the block further up in the blocks palette that just takes a key, not a key path (list of keys).

So here is the corrected version:
bucket_list.aia (3.3 KB)

In the spirit of never letting a good mistake go to waste, here is my post-review of the mistake ...

  • I stopped reading the block text in the palette after I reached the words set value for key but before encountering the word path.
  • I hadn't studied the more complex block, sticking to the simple block
  • The block nomenclature could use an update, perhaps using branch instead of key path, to avoid single word coding errors. Programmers designing their nomenclature are advised against using words and phrases that are too close to one another, to avoid slipping a gear.

I apologize for the error.

Now is OK !
Thanks !