Redefinition Warnings

Mathcad will warn you whenever an expression redefines an existing function, variable, unit, or matrix by flagging them with a wavy green underscore. You can change the default setting for warnings on the Warnings tab of the Preferences dialog.

In addition, Mathcad will also warn you if a redefinition occurs within a collapsed area or a referenced worksheet.

Redefinition warnings can be turned on and off with the keystroke sequence [Ctrl] [Shift] R.

Mathcad built-in functions

The flagged expression overrides the definition of an existing function. When you redefine a function as a variable, its original definition as a function is no longer available in the worksheet and may result in errors if used after the redefinition.

Certain functions will not be flagged if they are redefined: if, Find, Maximize, Minerr, Minimize, Odesolve, and Pdesolve. Additionally, the functions min, pF, and sec are also the names of built-in units; redefining one of these three functions will only be reported as a unit redefinition.

Mathcad built-in units

The flagged expression overrides the definition of an existing unit. This applies to all units, regardless of the unit system in use. If no unit system is in use in the worksheet, redefining a built-in unit such as m (meters) will not be flagged, as built-in units are undefined.

min, pF, and sec are also the names of Mathcad functions. They will only be flagged as unit redefinitions, and not as function redefinitions.

Mathcad built-in constants

The flagged expression overrides the definition of a built-in constant. Mathcad's built-in constants are e, p, ∞, and %.

Mathcad built-in variables

The flagged expression overrides the definition of one of Mathcad's built-in variables. Some built-in variables — such as ORIGIN — affect features from solve blocks to matrices to the writing of structured data files. Built-in variables should never be used for anything other than their intended purpose.

The following built-in variables will be flagged if they are redefined:

FRAME

CTOL

TOL

ORIGIN

CWD

ERR

PRNCOLWIDTH

PRNPRECISION

in0−in9

Previously defined functions or variables

The flagged expression overrides a function previously defined in your worksheet. When you redefine a function as a variable, its original definition as a function is no longer available in the worksheet. Note that global definitions of variable names will never be flagged with redefinition warnings, because of the order in which they are evaluated in a worksheet.

Previously defined matrices

When a matrix is redefined, complications may arise if the redefined matrix contains fewer rows and/or columns than the original. Because matrices are overwritten on an element-by-element basis, existing elements outside the range of the redefinition will not be nullified and may cause problems in your worksheet.

One or more expressions in this collapsed area redefine an existing definition

Collapsed areas allow you to hide regions in your worksheet. However, because these regions are not visible within the worksheet, you may not be aware of a redefinition that may cause an error or incorrect result in your worksheet. Expanding the area will display the problem expression.

Regardless of the display settings for the collapsed area, the icon will be visible when a collapsed area is flagged due to a redefinition.

One or more expressions in this referenced worksheet redefine an existing definition

Referenced worksheets allow you to include expressions from one worksheet within another, without retyping them. However, since these expressions are not visible within your worksheet, you may not be aware of their contents. Double-clicking on the reference will open the worksheet for editing.

Note: