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.

This article will cover:

  • How to disable and enable blocks
  • What happens to individual blocks when disabled
  • What happens when a block with nested blocks is disabled
  • Disabling and enabling a single nested block

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


How to disable and enable blocks

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.

disable_a_block.png

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.

enable_a_block.png


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.

grayed_out_block.png

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

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.

disable_loop.png

The image below 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.

grayed_out_loop.png

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.

enable_loop_menu.png

When the main block is enabled, all nested blocks within it will also be enabled.

enabled_loop.png

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

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.

Screen_Shot_2020-10-12_at_3.45.09_PM.png

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

enable_a_nested_block.png

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.

can_t_enable_that.png