Using the C++ Autocomplete Feature in VEXcode V5

Using the C++ Autocomplete feature while creating a C++ project in VEXcode V5 can help save time and prevent errors when typing commands.

Clawbot template diagram for VEX V5 robotics, illustrating the design and components used in C++ tutorials for building and programming the Clawbot.

Note: This project uses the Clawbot (Drivetrain, 2-motor, No Gyro) template.


Control-Spacebar

Screenshot of a C++ tutorial from VEX Robotics, showcasing code snippets and explanations related to V5 programming concepts.

One way to start using the C++ Autocomplete feature is with the Control-Spacebar shortcut on Windows, macOS, and Chrome OS.
To start, select the first open line in the int main () braces { }.

Diagram illustrating control space in VEX V5 C++ programming, showcasing key components and their relationships for effective coding in robotics.

Use the Control-Spacebar shortcut (by selecting the control key and the Spacebar at the same time). The device or command name will appear in a drop down selection menu.

Screenshot of a C++ tutorial from VEX Robotics, showcasing code examples and explanations related to V5 programming, with a focus on functionality and usage within the V5 platform.

Press ‘Enter/Return’ or ‘Tab’ on your keyboard or select the command with your cursor to make a selection. In this example, ‘Drivetrain’ is selected.

Note: With longer selection menus, you can make a selection using one of the following options:

  • Use your “Up” and “Down” keys to select the name you want, then press “Tab” or “Enter/Return” on your keyboard to make the selection.
  • Use your cursor to scroll up and down in the Autocomplete menu. Then make the desired selection.

Diagram illustrating the drivetrain selection process for VEX V5 robotics, used in C++ tutorials, showing various components and their connections.

‘Drivetrain’ will now appear on the line.


Using the Selection Menu

Screenshot of a C++ tutorial from VEX Robotics, showcasing code snippets and explanations related to V5 programming concepts.

If you know the command you are going to use, another method to use the Autocomplete feature is to select the first open line in the int main () braces { }.

Screenshot of a C++ tutorial from VEX Robotics, displaying code snippets and explanations related to V5 programming. The image illustrates key concepts and examples for users learning C++ in the context of robotics.

Begin typing the command. In this example, enter ‘d’ for Drivetrain. The device or command name will appear in a drop down selection menu. Select, ‘Drivetrain.’

Diagram illustrating the drivetrain selection process for VEX V5 robotics, used in C++ tutorials, showing various components and their connections.

‘Drivetrain’ will now appear on the line.


Using a Dot Operator

Screenshot of a C++ tutorial interface from VEX Robotics, displaying code snippets and instructional text related to V5 programming concepts.

Adding a dot operator (a period, ‘.’) will open a new menu of all commands available to the device. For this example select, ‘driveFor(direction, distance, units).’


Add Parameters

Illustration depicting the concept of 'Forward' in C++ programming, showing code snippets and visual elements related to the V5 robotics system.

Parameters are the options that are passed to the command between the parentheses. For this example select ‘forward.’

Screenshot of a C++ tutorial interface from VEX, showing code snippets and programming concepts related to V5 robotics, with a focus on educational content for users learning to program with VEX V5.

Some commands require multiple parameters. Use a comma to separate different parameters in the same command. Some parameters are values and a drop down menu will not appear. For example with the ‘Drive for’ command, enter ‘100,’ for the second value. Ensure that a comma is added after the value for a drop down to appear for the next parameter or unit.

Screenshot of a C++ tutorial from V5 Category Description, showing code snippets and explanations for programming concepts, with a focus on VEX Robotics.

Be sure to close the command syntax with a close parenthesis and a semicolon.

Screenshot of a C++ tutorial from VEX Robotics, showcasing code examples and explanations related to V5 programming concepts.

Some parameters are optional, such as the ‘false’ in the following example. For more information about parameters, view the command’s Help information to determine which parameters are needed, and which are optional.

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

Last Updated: