Variable and Function Names

Variable and function names can be of any length and can contain a variety of characters. There are, however, some restrictions. Variable and function names can consist of:

Restrictions

Operator symbols in names

If you want a variable name to contain an operator symbol and its associated placeholders, such as the factorial or integral symbol, you must use a special mode, most often used for chemistry notation.

  1. Press [Ctrl] [Shift] J to insert a pair of brackets with a placeholder between them.

  2. Type whatever letters, numbers, and operators are in the name.

For example,

Variables defined using operator symbols

Typing Reserved Keystrokes and Special Symbols in a Name

Some characters, such as $, are used to create operators and so can't be typed directly into a variable or function name. Other symbols require a sequence of character strokes, such as [Alt]0176 for the degree symbol °. Use "text in math" mode to type the actual symbol, instead of the operator, inside a variable or function name such as K$ or x@3:00.

  1. Type a letter or number to begin the name.

  2. Type [Ctrl] [Shift] K to enter a special "text" mode. The editing lines turn red to indicate you are in the special text mode.

  3. Type one or more symbols.

  4. Type [Ctrl] [Shift] K again to return to regular math editing mode.

Another way to get special symbols is to copy them from another Mathcad document, where the above steps have already been done. There is a QuickSheet that contains many useful symbols. To copy these symbols,

  1. Open QuickSheets from the Help menu.
  2. Click on "Math Symbols."
  3. Select the math symbol you want, move the cursor over the edge of the region until it becomes a hand, and drag the region to your worksheet.

You can also paste a symbol from another application. If you know the ASCII code, you can hold down the [Alt] key while typing the ASCII code using the numeric keypad. You can find codes for special symbols by choosing Character Map from System Tools in Accessories under the Program files in your Start menu.

Notes:

Related Topics