Understanding Control Structures in VEXcode Pro V5

The VEX Visual Studio Code Extension has replaced VEXcode Pro V5, which is now end-of-life.

VEXcode Blocks and VEXcode Text remain actively developed and supported for all VEX platforms.

In addition to individual commands, control structures can also be used in a project to control program flow.

This main structure is an example of a control structure. Main controls the program flow by indicating where the project should start. Control structures typically use curly braces instead of semicolons.

VEX V5 robot components diagram illustrating various parts and their functions, used in tutorials for understanding V5 category descriptions.

Another type of control structure is a while loop. The while loop repeats the code between its curly braces as long as the condition of the while loop is true.


Once the condition of the while loop is no longer true, the program flow will exit the while loop.  

The program flow will continue running any instructions in the main structure. Since there are no remaining instructions, the program flow will reach the main structure’s closing brace, which causes this project to exit.

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

Last Updated: