The Archive Command

archive.png

Command Summary

Moves a variable from RAM to the archive.

Command Syntax

Archive variable, [another, …]

Menu Location

Starting in the program editor:

  • Press F4 to enter the Var menu.
  • Press 8 to select Archive.

Calculator Compatibility

This command works on all calculators.

Token Size

3 bytes

The Archive command moves a variable, or several variables, from RAM to the archive. This serves two purposes:

  • More RAM is now available for other variables.
  • The variable is protected from being edited or deleted.

On the 68k series of calculators, a variable in the archive can still be read (compare this to the behavior of TI-83 series calculators, where doing anything at all to an archived variable is forbidden). However, trying to store anything to the variable will give an error: it must be unarchived first.

Variables in the archive are also protected from being deleted. This means that a DelVar command called on it will cause an error. Commands such as NewProb or DelType that delete multiple variables will skip over any that are archived. Finally, in the event of a RAM clear (which is more likely to happen by accident than a total memory clear), archived variables will be preserved.

Any type of variable can be archived. However, you cannot archive system variables (such as xmin) or variables beginning with _.

Advanced Uses

It seems natural to archive programs, since they usually aren't written to, and they are valuable enough that you want to give them some protection. However, keep in mind that the first time you run a program after editing it, it gets tokenized — the text is converted into tokens that stand in for commands. The process might take several seconds.

If you edit a program and then immediately archive it, it is "protected" from this conversion process. That means that every time you run the program, it will be tokenized. To avoid this, run the program once to tokenize it, and then archive it.

Error Conditions

140 - Argument must be a variable name happens when archiving a system variable or an invalid variable name.

870 - Reserved name or system variable happens when archiving a variable starting with _.

960 - Undefined variable happens when archiving an undefined variable.

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.