Examples for Every block for any component blocks

http://ai2.appinventor.mit.edu/reference/other/any-component-blocks.html

Maybe a little clarification of 'Every' vs 'Any' is needed here.

  • I want ANY one to make me a sandwich - I want lunch
  • I want EVERY one to make me a sandwich - I want to eat for a lifetime
1 Like

my question is about this

image

I need to understand the logic about the events in every block because i cant sinthezise my app because i dont know how can use the blocks any thanks

i read about these help in mit app inventor but just explain one block, and this block is "any button". So dont explain with other examples the other "blocks any". I appreciated too much if you show me the other examples with the other blocks "any component"

The same applies to other components

p40F5_every_button.aia (3.9 KB)

  • With every Button we avoid creating a list of buttons: make a list (Button1, Button2,...) manually.
  • Notice that the button's index is created automatically. It is not ordered.
  • Boton37 is different, due to the "notAlreadyHandled" block and having its own event: Boton37.Click
2 Likes

but you cant create a button list with a block that create 1 to 36 in one block?. for not create button for button in the list?. and call a number block using any component.

In the previous example I show two ways to create a list of buttons, with "every" and with "make a list", you can show other methods.

We could really do with an every componentName block as well (@vishwas )

You can get some semblance of control (for buttons) by returning the text value

1 Like

ahh ok i see that but i show you other method that i think so can be if its correct or no.

I think the OP is not talking about image, since this thread is open at May 2022, that time this block is not introduced.

We could really do with an every componentName block as well

100% agree with this comment. I addition to (or in place of) "componentName", I'd like to see every MIT App Inventor component have a String "tag" which could be set differently from the "componentName". Visual Basic, for example, allows components to be "tagged" differently from their name, which helps a lot when there are many of the same component and/or you want the tag to be different from, or simpler than the component name.

Visual Basic tag properly example:
https://www.vbforums.com/showthread.php?317182-Tag-property-in-VB6-0

It is not working with the" button.hight percentage"
"of component" (here I want to put the "every button" thing)
"To" (here : 90 %)

I will intitialize screen and than change the high percentage on all my buttons to a certain percentage

please provide a screenshot of your relevant blocks, so we better can understand, what you are talking about
Taifun

I don't know how to make a screenshot

Ahhh... Yess... I think this will really solving my problem.... Thanks

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


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

Yes, my Problem was that the green "every button" block don't work directly if it is putted in the place from the orange "get button" block, this might bi a bug to solve in the future or it is an idea to make the code shorter or more direkt, might this bi an idea for the developers?

There are computer languages like APL that let you input a list to an operation and see the operation apply to everything in the list.

AI2 is not one of those languages.

You have to add the loop, doing the operation one by one.