Disabling and Enabling Blocks in VEXcode GO

VEXcode GO 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.

Note: This article uses the Code Base configuration in VEXcode GO. See the Configuring a VEX GO Code Base VEX Library article for more information about how to configure a Code Base in VEXcode GO.


How to disable and enable blocks

VEXcode GO Blocks project with an enabled block's context menu opened and the Disable Block option highlighted. To the right the result is shown with the selected block now grayed out to indicate that it has been disabled.

In order to use the disable or enable blocks feature in VEXcode GO, the Brain must be connected to your tablet or computer, and VEXcode GO should be configured for your build.

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.

VEXcode GO Blocks project with a disabled block's context menu opened and the Enable Block option highlighted. To the right is the same project but with the selected block now in color to indicate that it has been enabled.

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

VEXcode GO Blocks project containing a disabled block. The block is grayed out and has a grid of diagonal lines over it.

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 this example, the Code Base will drive forward for 500 millimeters (mm) and then stop; it will not turn.


What happens when a blocks with nested blocks is disabled

VEXcode GO Blocks project with an enabled container block's context menu opened and the Disable Block option highlighted.

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.

VEXcode GO Blocks project with a container block and all of its nested blocks disabled. The blocks are grayed out and have a grid of diagonal lines over them.

This 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.

VEXcode GO Blocks project with a disabled container block's context menu opened and the Enable Block option highlighted.

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.

VEXcode GO Blocks project with a container block and all of its nested blocks enabled.

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 Code Base will drive forward to 500 millimeters (mm), then turn right for 90 degrees, and repeat these behaviors 4 times to drive in a square.


Disabling and enabling a single nested block

VEXcode GO Blocks project with an enabled block's context menu opened. The block is nested inside of a container block, and the Disable Block option is highlighted. To the right the result is shown, with the selected block now disabled.

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.

VEXcode GO Blocks project with a disabled block's context menu opened. The block is nested inside of a container block, and the Enable Block option is highlighted. To the right the result is shown with the selected block now enabled.

To enable that nested block, you will need to right-click or long-press to activate its Context Menu.

VEXcode GO Blocks project with a container block's context menu opened and the Enable block option highlighted but grayed out. One of its nested blocks is disabled, but the Enable block option isn't available since the container block itself is still enabled.

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.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: