Identifiers
Identifiers are merely names for variables and functions. Programmers must know the names of built in variables and functions to use them in scripts and must know some rules about identifiers to define their own variables and functions. The following rules are simple and intuitive.
•
Identifiers may use only ASCII letters, upper or lower case, digits, the underscore, "_", and the dollar sign, "$". That is, they may use only characters from the following sets of characters.
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789"
"_$"
•
Identifiers may not use the following characters.
"+<>&|=!*/%^~?:{};()[].'"`#,"
•
Identifiers must begin with a letter, underscore, or dollar sign, but may have digits anywhere else.
•
Identifiers may not have white space in them since white space separates identifiers for the interpreter.
•
Identifiers may be as long a programmer needs.
The following identifiers, variables and functions, are valid:
Sid
Nancy7436
annualReport
sid_and_nancy_prepared_the_annualReport
$alice
CalculateTotal()
$SubtractLess()
_Divide$All()
The following identifiers, variables and functions, are not valid:
1sid
2nancy
this&that
Sid and Nancy
ratsAndCats?
=Total()
(Minus)()
Add Both Figures()