Documentation Center

  • Trial Software
  • Product Updates

HISTORY

Maximal number of elements in the history table

Description

The environment variable HISTORY determines the maximal number of entries of the history table at interactive level.

Possible values: Nonnegative integer smaller than 231.

The commands that are entered interactively in a MuPAD® session, executed in a procedure, or read from a file, as well as the resulting MuPAD outputs are stored in an internal data structure, the history table. Only the most recent entries are kept in memory.

Entries of the history table can be accessed via history or last.

The default value of HISTORY is 20; HISTORY has this value after starting or resetting the system via reset. Also the command delete HISTORY restores the default value.

Within a procedure, the maximal number of entries in the local history table of the procedure is always 3, independent of the value of HISTORY.

Examples

Example 1

In the following example, we set the value of HISTORY to 2. Afterwards, only the two most recent inputs and outputs are stored in the history table at interactive level:

HISTORY := 2:
a := 1: b := 2: max(a, b):
history(history() - 1), history(history())

The attempt to access the third last entry in the history table leads to an error:

history(history() - 2)
Error: The argument is invalid. [history]

We use delete to restore the default value of HISTORY:

delete HISTORY: HISTORY

See Also

MuPAD Functions

Was this topic helpful?