Creating an Empty List

For now, we’re going to make some lists and store them in variables. This is a common technique, but keep in mind that lists don’t always have to go straight into variables.

To create our first list, we’re going to create a global variable definition (refer to Chapter 4, “Variables”) and drag in the create empty list block (see Figure 6.4).

Image

Figure 6.4 Create a global variable definition and drag in the create empty list block.

Now we have a list! We can give it a name by renaming the global variable. Let’s call it my_list (see Figure 6.5).

Figure 6.5 Rename the global variable to my_list.

Now whenever you use the ...

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.