|This article or section contains information about a feature from a future version of Scratch that is unreleased and is subject to change. Please cite any additional info in order to prevent speculation.|
Procedures allow you to make your own programming blocks. They allow a sequence of blocks to be grouped together and called by a single name.
Procedures can be found in many programming languages, and may also be called functions or methods.
You can think of the blocks in Scratch as being procedures themselves, but made out of compiled code and not other blocks. Procedures can have inputs, or parameters, which can give the procedure more information. For example, the "move (10) steps" block has a single argument, the number 10, which tells the block how far to move.
Procedures in Scratch
Custom blocks can have arguments of strings, numbers, and booleans. After naming and adding arguments, a Define block is created. For each Define block (whether from the make a block button, or by dragging in from the backpack or another sprite), a custom block is created in the palette. The custom block is only available to the sprite that has the Define block.
custom block [hi] (42) <touching color [#0bb]?> define custom block (string) (number) <boolean>
Custom blocks can only be stack blocks, not reporters or booleans (though they may be added in the future).. They support recursion, so blocks can call themselves. (This doesn't stop the current block executing, unlike broadcasts). They can be set to run atomically or "all at once".