Variable and Function Names
Variable names, function names, unit names, constant names, etc, are generically referred to as identifiers.
Identifiers can contain any valid Unicode character from the Base Multilingual Plane (BMP) with the exception of white space and control characters, and with the additional limitation that the first character cannot be a decimal digit (0-9). Unicode BMP characters are defined as having a code in the range 0-65535.
The label associated with an identifier is considered part of its name when distinguishing it from another identifier. This makes it possible to define a new function mean with the Variable label, and still be able to refer to the built-in function mean by specifying the Function label. However, if you define a new function mean with the Function label, you will be hiding the built-in definition of that function.
Identifiers are case-sensitive, can be of any length, and may contain any combination of valid characters:
Letters—Uppercase and lowercase letters.
Digits—0 through 9, but not as the first character of a name. PTC Mathcad interprets leading digits in combination with letters as either an imaginary number (2i or 3j) or as a number times a variable (3x).
Dot—A single, punctuation character, period can be used any where; including as the first character.
Symbols:
Underscore _.
Any symbol listed on the Math tab, in the Operators and Symbols group, in the Symbols list. To enter a Greek character, type the Roman character followed by Ctrl+G. For pi, type p and then Ctrl+G.
Any constant listed on the Math tab, in the Operators and Symbols group, in the Constants list.
Other standard symbols. You can refer to the Windows Character Map dialog box for special symbol codes.
To access the MS Windows character map, click Start > Windows Accessories > Character Map.
Literal subscripts—Any combination of valid characters; including a number as first character.
A subscript may be placed anywhere in the identifier.
An identifier may contain multiple subscripts such as H2SO4.
Additional Information
Identifiers cannot contain symbols that have special meaning to PTC Mathcad, such as those listed under the Math tab, in the Operators and Symbols group, in the Operators list.
You can assign different labels to the same name. For example, you can enter the expression f(x) and label it as a function and then enter the expression f and label it as a variable.
Certain names are already used for built-in constants, variables, or functions. If you redefine these names, their built-in meanings no longer work after the redefinition. For example, if you define a function called mean, you override the functionality of the mean built-in function.
Was this helpful?