Because Raptor is a graphical language, Raptor programs tend to rely less on words than most text-based languages do. However, words still appear in Raptor as variable names, subchart names, procedure names, and function names. In computing circles, these names are known as identifiers, and programs must follow certain rules to build correct names or identifiers.
A name must begin with a letter
After the first letter may come any sequence of letters, digits, or underscores
Spaces are not allowed in a name - a space marks the end of a name
Names are NOT case sensitive. Therefore,
get_mouse_button means the same thing as Get_Mouse_Button and GET_MOUSE_BUTTON
Count means the same thing as count
A name may NOT represent more than one thing in a program. Therefore,
a program may not use a variable called e, because e is pre-defined in Raptor
a program may not use a variable called red, because red is pre-defined in Raptor
a programmer may not create a subchart called Get_Key, because Get_Key is already defined
In addition to the above rules which Raptor enforces without exception, there are common naming conventions that should be used to avoid confusion, make programs readable, and minimize the occurrence of errors.
Suggestions for Meaningful Variable Names in Raptor
Programmers use meaningful variable names so the names themselves identify what each variable is used for. Below are some rules of thumb for naming variables.
Use variable names made up of words that describe the contents of the variable
velocity is a better name than v
Use underscores to make compound words readable
uav_velocity is a better name than uv or uavvelocity
When doing conversions between units, make the units part of the variable name
theta_radians and theta_degrees leave little doubt about the units for the stored values