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

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


Control-Spacebar

2020-11-05_10-05-35a.jpg

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 { }.

control_space.png

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.

2020-11-05_10-06-35.jpg

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.

Drivetrain_select.png

‘Drivetrain’ will now appear on the line.


Using the Selection Menu

2020-11-05_10-05-35a.jpg

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 { }.

2020-11-05_11-09-42a.jpg

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

Drivetrain_select.png

‘Drivetrain’ will now appear on the line.


Using a Dot Operator

2020-11-05_11-20-34a.jpg

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

Forward.jpg

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

2020-11-05_11-43-47a.jpg

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.

2020-11-05_11-59-09a.jpg

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

2020-11-05_11-55-59.jpg

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: