Applying Naming Rules with Variables in VEXcode 123

In VEXcode 123, 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.
    Illustration showing a large number with a red circle and a slash through it, indicating that special characters are not allowed in names, relevant to VEX Robotics and VEXcode VR tutorials.
  • The name has to begin with a letter. It cannot start with a number.
    Illustration of a second wheel component for VEX Robotics, demonstrating its placement in a robot assembly, relevant to the Block Tutorials section of VEXcode VR Overview.
  • The name cannot use spaces.
    Image showing a previous number icon with a red background, illustrating the concept of naming conventions without spaces in VEX Robotics block tutorials.
  • The name cannot be a reserved word in VEXcode 123. A reserved word is a word or name that VEXcode 123 is already using. Examples: for, while, break, else, not.
    Illustration showing reserved words in VEXcode 123, including examples like 'for', 'while', 'break', 'else', and 'not', emphasizing that these names cannot be used in programming within the VEX Robotics environment.
  • 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 of a VEXcode VR block tutorial showing various programming blocks and their functions, illustrating the process of creating a simple robot program in VEX Robotics.

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

Last Updated: