Name Rules for Variables and Devices in VEXcode IQ

In VEXcode IQ, you are required to give a name to a new variable when you create one. You also have the option to change a device’s name in the Robot Configuration. 


Valid Name Rules

Variable names must be unique, but there are other specifications that the name must follow. 

Variable names are used in the following places:

  1. Device (created using Robot Configuration)
  2. Numeric (created using “Make variable”)
  3. Boolean (created using “Make a boolean”)
  4. List (created using “Make a List”)
  5. 2D List (created using “Make a 2D List”)


Here is an overview of the criteria when choosing a valid name:

Screenshot of a VEX IQ Blocks tutorial interface, showcasing programming blocks and options for building and controlling VEX IQ robots, aimed at educators and students learning robotics concepts.

The name cannot use special characters.

Screenshot of VEXcode IQ Blocks interface, showcasing programming blocks for VEX IQ Robotics, used in educational tutorials for building and programming robots.

The name has to begin with a letter. It cannot start with a number.

Screenshot of a VEX IQ Blocks programming tutorial, showcasing a visual interface with various programming blocks for educational robotics projects.

The name cannot use spaces.

Screenshot of a VEX IQ Blocks tutorial interface, showcasing programming blocks and options for creating robotic commands, aimed at educators and students learning about the VEX IQ Robotics platform.

The name cannot be a reserved word in VEXcode. A reserved word is a word or name that VEXcode is already using.

Examples: vex, Brain, time, for, while, break, else, not.

Screenshot of a VEX IQ Blocks tutorial interface, showcasing programming blocks for robotics education, designed for beginners and educators to enhance learning and project development in the VEX IQ platform.

The name has to be unique (only used once), but you can have different cases (one uppercase and one lowercase).


Possible Name Errors

Screenshot of a VEX IQ Blocks programming tutorial interface, displaying various coding blocks and options for programming VEX IQ robots, aimed at educational and beginner robotics enthusiasts.

When you create a variable name, if you see a “Name Taken” error, it means there is a duplicate name in any of the groups above.

Screenshot of a VEX IQ Blocks Tutorial interface, showcasing programming blocks and options for building and controlling VEX IQ robots, aimed at educational and beginner robotics enthusiasts.

You may encounter a case when opening a project made in an earlier version of VEXcode IQ that has a duplicate variable name. This will cause an error when compiling and you will see the error message:

The error message to the left shows the following problems:

  • The name “myvariable” was found as a numeric variable and a boolean variable. 
  • The name “awesomeVar” was found as a numeric variable and a boolean variable. 

To resolve the error, one of the duplicates will need to be removed or changed so they are unique.

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

Last Updated: