Types of Procedures

The Procedures drawer has two Procedures blocks: do and result. You can find them by clicking the Procedures block in the drawer (see Figure 5.2).

Image

Figure 5.2 The do and result procedures.

The do procedure collects a sequence of blocks into one group. This same collection of blocks can then be called later, which means the blocks in this do group will be run in order every time you use the procedure. When you give the set of blocks a custom name, that set appears below the do and result options in the drawer.

The result block has a differently shaped slot. This kind of procedure provides a result value when it is done. 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.