O'Reilly logo

Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps by Mark Sherman, Derek Walter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Local Variables

The last type of variable is the local. It is a variable, so we know that it is a storage location with a name where we can put values in and read them out. A local variable needs to be explicitly initialized, like a global, and uses orange getters and setters, also like a global. What makes this one different is that the scope of the variable is limited. You can actually control exactly what the scope is, and that’s both cool and useful. Take a look at a local variable block in Figure 4.16. Note the notches on the top and bottom. Those mean that it clicks into a stack of action blocks: setters, procedure calls, and so on. It also has the same notch inside it, where you can put more action blocks. In addition, you can see an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required