VEXcode 123 allows users to disable and enable blocks within their projects. This is a useful feature for students when testing or debugging a project, so they do not have to take the project apart to figure out what is not working as intended. The user can disable or enable a block(s) to test and observe the differences in the robot’s behavior when that block is or is not in the project.
How to disable and enable blocks
In order to use the disable or enable blocks feature in VEXcode 123, the 123 Robot must be connected to your tablet or computer.
Disabling a block will keep it from being executed when the project is started. To disable a block, right-click or long-press on the block to activate the Context Menu, and then select Disable Block. The block will then appear grayed out with a grid of diagonal lines over it in the project.
To enable the block so that it is executed when the project is started, right-click or long-press on the disabled block to activate the Context Menu, and then select Enable Block.
What happens to individual blocks when disabled
While a block(s) is disabled, it is shown grayed out with a grid of diagonal lines over it.
The disabled block is treated like a comment. It has no effect on the flow of the project, and will not be executed when the project is started.
In the example above, the 123 Robot will drive forward for 1 step and then stop; it will not turn.
What happens when a blocks with nested blocks is disabled
When you disable a block that has blocks nested within it, all of the blocks are disabled. Blocks like a loop or if-then-else conditional, that have nested blocks, can be disabled in the same way a single block can.
Right-click or long-press to activate the Context Menu of that loop or conditional Control block, and then select Disable Block.
The image shows what happens when the repeat loop is disabled. The loop and the two blocks inside of it were all disabled, and they all appear grayed out with a grid of diagonal lines over them.
In this example, nothing will happen when the project is started, as all of the blocks are disabled. You can enable the main block, and all nested blocks within it, by activating the Context Menu of the main block and selecting Enable Block.
When the main block is enabled, all nested blocks within it will also be enabled.
In this example, now that the main block is enabled, when the project is started, the 123 Robot will drive forward 1 step, then turn right for 90 degrees, and repeat these behaviors 4 times to drive in a square.
Disabling and enabling a single nested block
You can disable a single block within a series of nested blocks, like a loop or if-then-else conditional, by following the same steps for disabling any other block: right-click or long-press to activate that block’s Context Menu and select Disable Block.
In this example, a single block within a loop is disabled.
To enable that nested block, you will need to right-click or long-press to activate its Context Menu.
Note that the Context Menu for the main block (in this case the [Repeat] block) will not provide an option for enabling the nested block, because the main block itself was not disabled.