7.2 Understanding Procedures
Every command given to the GoGo Board must live inside a procedure. In the example above, the procedure name is “dobeep”. In Logo, a procedure consists of the following structure:
A procedure begins with the keyword “to” followed by a name. Next is the procedure body where all the commands needed for the procedure can be written. In Logo, more than one command can be written on the same line. However, the commands can take up as many lines as needed. Finally, a procedure always ends with the keyword “end”
In Tinker, the start and end of a procedure is taken care of visually.
Many procedures can be created. In Logo, the first procedure will be executed when pressing the Run! Button. In Tinker, the primary procedure is colored blue. All other procedures created afterward will become secondary (they also have a different color).
Here are guidelines about how to name a procedure:
- A procedure name cannot be the same as a Logo command.
- A procedure name must not include space or other non-alphabetical characters.