Displaying a List

I’m working through the Lists Tutorial. I have initialised a global variable called ListAO to make a list and put 3 items in it.
I have created a Label called FirstListContents
I have done the:
for each item in list get global ListAO
do: set FirstListContents.Text to join FirstListContents.Text with get item and ” ”
exactly as in the tutorial notes.
However, on my companion, the only thing that displays is the label heading, not the items in the list.
What am I missing here?

1 Like

Where is that?

I find this block an easy way to show a list in a Label.Text:
(from my To Do List project)

In the Oh My Spikes Tutorial, at the end of the paragraph on SPIKES_Y_POS there is a link to 'list tutorial'. Section 3. Display List items. It looks really simple but I can't make it work.

You are reffering to List Blocks On App Inventor | Imagnity Please post a screenshot of your blocks so we can see what is the problem

According to example

Many thanks. Got it!

1 Like

Hi Dora
How would you make each item list on a new line?

Using \n instead of empty spaces

Thanks again

1 Like

You can use also listview component to display a list
Set listview1 element to get listname

Got it. Thanks to all for your swift responses

This 2nd way keeps giving me a runtime error of undefined variable...

Post a screenshot of your blocks

Use only one not both procedures .

I have; it still doesn't work.

Looks like you are using the IOS companion ?

The list separator block has not made it into IOS yet.

1 Like

OK, thanks. So, there is a bug here.

When I use my phone as companion, it works instantly.

When I use my Apple mac as companion, on which I'm also doing the coding, it does NOT work. I have refreshed, hard re-setted, etc, but it definitely doesn't work using the 'join items using separator' method.

OK. I get it. So the same issue arises when I try to use the list separator with the ios on my ipad.

That's a shame. It would be really useful for class teaching because it's the simplest way to show a list.

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