Understanding Name Rules for Variables in VEXcode VR

In VEXcode VR, you are required to give a name to a new variable when you create one.


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. Numeric (created using “Make variable”)
  2. Boolean (created using “Make a boolean”)
  3. List (created using “Make a List”)
  4. 2D List (created using “Make a 2D List”)


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

  • The name cannot use special characters.Image showing a large number with a red background, illustrating the concept that names cannot use special characters, relevant to VEXcode VR tutorials on coding principles in a virtual programming environment.
  • The name has to begin with a letter. It cannot start with a number.Illustration of the VEXcode VR interface showcasing a virtual robot and coding blocks, designed to facilitate learning coding concepts through simulation in the Tutorials section.
  • The name cannot use spaces.Image illustrating the restriction that names cannot contain spaces in VEXcode VR, a programming environment for coding concepts using a virtual robot, aimed at enhancing STEM education through tutorials.
  • The name cannot be a reserved word in VEXcode VR. A reserved word is a word or name that VEXcode VR is already using. Screenshot showing examples of reserved words in VEXcode VR, illustrating the importance of avoiding these terms when naming variables or functions in the programming environment.Examples: for, while, break, else, not.
  • The name has to be unique (only used once), but you can have different cases (one uppercase and one lowercase).ALT=

Possible Name Errors

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 showing variable duplication in VEXcode VR, illustrating how to manage and utilize variables within the programming environment to enhance coding skills and problem-solving in a virtual robot simulation.

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

Last Updated: