Skip to content
Property Value
Hex Value $FA
Categories
Localizations
  • FR: EffListe

ClrList

Overview

Sets the dimension of one or more listnames to 0.

Availability: Token available everywhere.

Syntax

ClrListlistname1[,listname2, ...,listname n]

Arguments

NameTypeOptional
listname1listName
listname2listNameYes
listname nlistYes

Location

stat, EDIT, 4:ClrList


Description

ClrList sets the length of a list (or several lists) to 0. This is virtually equivalent to deleting the list, except for several differences:

  • The list still exists — it will be shown in the memory management menu and the list menu
  • Calling the dim( command on it will return 0, rather than an error.
  • ClrList can clear multiple lists at the same time

Advanced Uses

You might use ClrList when building up a list element by element and using dim( in the process:

:ClrList L1
:While 10>dim(L1
:Input X
:X→L1(1+dim(L1
:End

Optimization

Using DelVar instead of ClrList allows you to save a tiny bit of memory (between 12 and 16 bytes) that ClrList doesn't delete, while keeping almost every aspect of the list clearing the same. If you are clearing several lists, you can separate them with commas as the arguments to ClrList, which can save space. Using ClrList is also substantially faster than DelVar if the list is going to be cleared many times.

Error Conditions

  • ERR:SYNTAX is thrown if you leave off the ʟ symbol when referring to a custom list (i.e., ClrList B will not work; you have to use ClrList ʟB).

Source: parts of this page were written by the following TI|BD contributors: burr, DarkerLine, GoVegan, jonbush, Myles_Zadok, Timothy Foster.

History

Calculator OS Version Description
TI-82 1.0 Added
Authors: Adrien Bertrand