Eng:Cap Block

A Cap block is a block that is designed to stop a script or project from running, cancelling unwanted activity before it can start.

The Cap blocks
There are two Cap blocks, both located in the Control category. They are:


 * Stop  stops either everything, the script or the other scripts in the sprite. If "stop other scripts in sprite" is selected, it becomes a stack block.
 * Delete This Clone stops all the scripts that the clone is running and deletes the clone

Shape
As Cap blocks are designed to stop a script or project, their bottom is smooth; no blocks can be placed under them, as there is no need. Other than that, their shape is identical to the Stack block they still have the notch on the top, so the block can be placed below others.

Making A Cap Block
The coding in the System Browser blockspecs for a cap block is the same as a stack block. To make the bottom smooth, the method at the location  must be edited. Add:

and accept.

Use
The need to stop a script (or all scripts) can be found in several occasions. Some include: An example follows:
 * Disabling a script that will continuously set a variable
 * Once a game is completed, all scripts stop
 * Deactivating a sprite

set [Letter v] to [0] repeat (length of (answer)) change [Letter v] by (1) if <(letter (Letter) of (answer)) = [z]> then stop [this script v] end end

Note how the Cap block (Stop ) is used if the selected letter is "z", the script stops.

Blockform = Abschluss-Blöcke