Stack#

The Switch Stack block is used to execute Switch Python commands typed within the open space of the block.

They are shaped to attach above or below other stack blocks.

a VEXcode Switch Blocks Example showing a Switch Stack Block#
 [                           ] :: custom-switch

Select the open space of the block indicated in the image here and begin typing.

Illustration of a Switch Stack block for entering Switch Python commands in a programming environment.

Switch Stack blocks can be used for single lines of Switch Python commands or multiple lines.

In order for a Switch Stack block to function as intended, the Switch Python commands must be entered with the correct spelling, punctuation, and indentation. Refer to the Help of each block to see the matching Switch Python command.

In this example, the Drivetrain will move forward for 400 Millimeters.

a VEXcode Switch Blocks Example showing a Switch Stack Block with switch python commands for driving forward for 400mm#
 when started :: hat events
[drivetrain.drive_for(FORWARD, 400, MM)] :: custom-switch