TI-BASIC Wiki
Register
Advertisement

Lists (sometimes called Arrays in other languages) are structures that can hold up to 999 individual values, or 99 on the TI-83. In TI-84-BASIC, Lists can only store Real or Complex values. In TI-89-BASIC, Strings as well as Real and Complex values can be stored in lists.

Lists can be dimensioned in this format:

:{number1[,number2,...,numberN]}

Users of most other programing languages should take note that in TI-BASIC the first value in a list is indexed as 1, not 0.

To change an individual item in a list, the following construct is used:

(84) :numberlistName(position)
(89) :valuelistName[position]

To access an individual item in a list, the following construct is used:

(84) :listName(position)
(89) :listName[position]

The size of a list can be accessed using the dim( command.

Variables[]

TI-89[]

In TI-89, like all variables, any variable name can store a list.

TI-84[]

Default[]

L1 - L6 found on the keypad.

Defining Lists[]

Custom lists can be defined in TI-basic. They all start with the L character, and can consist of up to 5 additional characters. They must start with a letter.

:LALIST

Use in programs[]

High Score Lists[]

One use for lists in game programs is to create a custom list and save high scores onto it. You can do this by adding it to the list and then deleting the extra at the bottom. (after the list is sorted)

In code, for LSCORE of size 10 and new score S, this is:

:11→dim(LSCORE)
:S→LSCORE(11)
:SortD(LSCORE)
:10→dim(LSCORE)

! This article is a stub. Please help the TI-BASIC Wiki by expanding it

Advertisement