How do you get the max text length between or from each Label?

How I get the max textlengt, with the every label block... If it's possible without use of list or other things between, the simplest way..... If it's possible, that I can understand it better..... Short..... Later it's possible to add other functions like list or other things, but in the moment I will learn only this part... Thanks a lot... :slight_smile:

Do you mean for all the words in a sentence/paragraph ?

e.g. "the fast brown fox" should return 5, brown

What should happen if there are two or more words of the same length?

Ahhh this is a good question, you see, and because this you are the master, and I am only the student, .... Hmm... Sometimes a thing like do loop until comes a bigger length?

Use a clock timer and test length on each iteration of the clock?

hmmm.... How about a sort algorithm? And then we can put it under clock system.
What about a for each loop ? I m only don't know how to use the block's properly .... Because this I asking

Show your relevant blocks so far, or at least a layout of what you are trying to achieve

I do not know what it means. Describe it in more detail.

I have only this information, because I am a beginner in mit App Inventor and I don't know with which other blocks I must combine it to reach the result....

Yes I understand yo, a pile of words and then the max out of this..... But how?

Ok... Step one : we need to make a list from every label?

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 to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

And learn how to work with lists


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

Try this simple example:


Method 1 is better because it does not create a list of text that may occupy the cache, but a list of labels. Only then do we read the text from each label.

How to make a list with the" every label "block from the "any components "system ? The simplest and shortest way, if it's possible? Taaaaanks a lot :slight_smile:

Then I can look at the" sorting list method" from the tutorial to understand the system.

but first i need this every Label thing solved... and when I understand it then it make sense to try the Next step


get all lenghts

or get max

Ok, now I understand your approach in method 1,.. there I see for "for each block" ... Instead of the first 5 set block's , let make the "every label block" fill the list ? And a other cuestion between, is it possible to use the make list block directly in the sentence , without declaring a list name with the "set global name of the list" block?, And use it directly out of the list?

And then the max out of the textlengt numbers out of the list?,

And this then is the needed variable to work with :slight_smile:

However, this method will be good when we do not use any other labels in the application, except those in which we want to count the text length. This block returns all labels applied to the app.

Ouch, you was make the adjustments while I writing my cuestion .... WOW YOU ARE FAAAST!!!!!! YOU ARE CRAZY GOOOOOD!!!! WOOOOOW!

Ok, whery fine, now, .... Can we work directly and use the data provided by the" every label block" without the 5 first green "set label " block's?

And from this the textlengt from every label first filled in the for each label loop, and then the max textlengt out of this, excuse when I write so slow...

"However, this method will be good when we do not use any other labels in the application, except those in which we want to count the text length. This block returns all labels applied to the app."

Yes this was my question , and excuse to that my reading was slowly to, (and my understanding speed)....

Ok an then we need the max from the textlengt out of this, then I can work with this variable later on .

I understand that you want to select the longest text from the length of all labels?