Show Old Labels And Also New Labels If Number Add In A Loop

How can I code in the way such that label1 will visible and if 1 is added in previous number, then label1 and label2 will both visible and if again 1 number is added in the previous number, then label1 , label2 and label3 all will visible. I used a loop and total labels are 29. When number reaches at 29, all labels must visible.

where does this happen ?

What have you tried so far? What will happen if 5 is added to previous number ? then next 5 labels will be visible ?

Maybe you could use [F/OS] - Dynamic Components Extension (for every component) 2.2.2 - Extensions - Kodular Community and you could create labels dynamically

Shows Previous 4 Labels and also show Labels.

Try this and see if it works for you (using dynamic components)

dyn_labels.aia (34.9 KB)

Don't use Labels.

Use a list of numbers and a List View or List Picker to show the list.

Load their Elements from the list.

Please check this image:


I want this will happen by automatic or short code. I have to take Number till 29.

follow the DRY principle - Don't repeat yourself

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

2 Likes

I repeat old blocks when Number increases but also add new blocks.

Are you trying to make a calendar or .. ?

No, here I used a loop in which if Number increases, then it set values to new variables and then show both all previous variables and new variable (in which values is inserted when Number increase by 1),

Ok I misunderstood because in your blocks I saw MON,TUE,WED ....

Ok no problem but please help me in making shortcut for the code because I have to take Numbers till 30. And when Number is 0, blocks are 12, and when Number is 1, blocks are 24 and when when Number is 2, blocks are 36.
So please help me to find a shortcut for the code.

This is the block you need:
controls_forRange

I have to add more blocks when Number increases but using this block only Number is increasing and variables are same.

Can I share you my .aia file, then you can give me some tips?