Set text to a label in a list

In Thunkable Drag and Drop I have 11 labels, each setting an appvar WhichLabel (1 to 11) when pressed, so I know the position of the pressed label.
I also have a list of them: Set LabelList to +list L1, L2…L11.

I want to be able to change the text of the pressed label based on other conditions.
I then test the position (1 to 11) to determine the new text.

I want to change the text of the pressed label using the indexed array, not repeating the code in each label click.

I’ve tried
Count with I from 1 to 11
set property “text”
of object in list +list app var LabelList get # i
To app var GotLabel

This does not retrieve the proper label, so the text is not updated.

How can I do that? Any better idea?

I can help with this but it would be best to post a link to your project so I can modify what you have and explain the changes.

Is the idea that when the user clicks on a label, the label’s text updates with the next consecutive number? For example, “button 3” becomes “button 4” or is this more like a calculator where the total gets updated when certain buttons are pressed, like “3” “+” “4” becomes “7”?

Hi tatiang,
I’m guessing this goes directly to you.

I’m a newbie to Thunkable (I have done LOTS of code with basic, yeah basic) and don’t know how to post a link. I’d be happy to if I knew how.

The idea is to change the normal blank label to different texts, depending on other conditions. Set property “text” of object in list does not work. I JUST learned about set label component’s text to “label”, but haven’t tried to use it yet. Some of Thunk’s blocks are really hard to find, and NO docs telling about their many quirks. Lists of labels do not work as a real array, so I am stuck.

I would sure appreciate any help you could give.

Regards,
Clark

1 Like

Uh oh… Basic. That’s what I grew up with! Loved making choose your own adventure games in Basic on a Commodore 64. Those were the days.

This will show you how to share a link to your project: Share Your App | Thunkable Docs

It creates a copy of it so that any changes I make to it do not affect the original version you have. Typically, I can then share screenshots of changes or a link to the updated project so you can continue to edit it.

Here is the share link:

https://x.thunkable.com/copy/0eb607c61648b82a9f7d4a76b71eaa0f

I made a lot of changes since I posted, and it is working A LITTLE. It only gives a ? If I guess at the top row. If I remove the wait on each ShowRGuess it doesn’t work. The game is to guess R G B levels to match the random target. I want a ? for each guess and X for the last accepted guess. Each guess should erase previous guesses. I saw this game at Epcot about 50 years ago and coded for my kids on an Apple II that I bought from Mark Wasniak, Steve’s brother. Haven’t coded anything for at least 10 years and wanted to revive it for my grandkids.

Sure hope you can figure this out. ChatGPT was surprisingly pretty useless.

Regards,
Clark

In another coincidence of… age… my best friend won a bicycle from Steve Wozniak when he visited my friend’s school about 40 years ago. He still talks about that!

ChatGPT isn’t that much help with Thunkable. It tends to pull outdated or incorrect information. I think it’s especially hard since it’s not technically a scripting language (which AI bots do best with).

I’m heading out tomorrow morning for a camping trip with my 5th grade students so I’m not sure I can get to this tonight but someone else may be able to take a stab at it.