Creating a List with Some Stuff Already In It

Now we’re going to create a list in a different way. We’re still going to initialize a global variable, but we’re going to use the make a list block, which takes inputs. You can change how many items the make a list block will accept (how many input sockets it has) by clicking the gear and dragging items into and out of the mutator that pops up (see Figure 6.7).

Image

Figure 6.7 Drag items into the mutator until you have the number of list items you need.

Add one more item to the list block so that it has three inputs. Then we’ll give it three pieces of data, which will be in the list right away when ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.