"Code is written in blocks and a typical code block consists of a set of instructions, called statements, that are then interpreted by GameMaker and used to make something happen within your game." (GameMaker Manual - Basic Code Structure).
Code blocks are a necessary way to group together statements of code to be run sequentially. For example, one may want a block of code to only run when a condition is true, so the following code is grouped in a block after the conditional.
The top-level code block is represented by whatever code editing window is open. Any further subordinate blocks are marked with an opening {
and closing }
.
Variable scope is limited based on the code block a variable is defined in.
Can code exist outside of a code block?