Call items from list of lists

While reading the manual, I found that one can create lists of lists, and they may show like an excel document. Imagine that I have a main list with 2 lists inside:
List 1: Bill ; Clinton
List 2: George; Bush

Then I will the list as an excel documento, where "Clinton" is the B1 cell, George the A2, etc....How can I call a specific item from a list of lists?

Imagine that I want the B2, I want a simple Sprite to say (using the Say block) "Bush", how can I do it? Because when I use the block "item__of [list]", I cannot write "A2" or "b1", etc.

I hope you can uderstand my english and my question...

Thanks

your list looks like this as a table
image
but your list really looks like this
image
looking at this, you can tell that there's lists inside the list. If you get item 2 of the list, you get
untitled script pic - 2020-10-30T142121.582
a list. and you can tell you can just get item 2 of that new list to get bush
untitled script pic - 2020-10-30T142250.381

image
This should work.

Thanks all of you. Very simple indeed, but I didnt knew that worked like that.

Do you know any good book, YT chanel, whatever, to learn basic stuff related to Snap? I only use it veeeeery loosely...very few times a year when I have time and when I want to make a simple project just for fun. Well, sorry for the offtopic, maybe better a new topic for that lol

There's the manual that i never bothered to read. That's probably useful.

For a simple 2-D array, composing two calls to ITEM is probably best, but you can also accomplish the extraction of individual scalar items by calling ITEM with a list of lists of indices:


The reason this isn't better is that the result is still a 2-D array, but with only the second column of the first row. If you load the APL library, you can use SCALAR VALUE to get the actual item you want:

The reason for the complicated list-of-lists format for the input to ITEM is that you can select more than one column and/or row, and in any order:

But yeah, read the manual!

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