Chapter 11: Lists
169
With two or more lists,
SortA(
and
SortD(
sort
keylistname
, and then sort each
dependlist
by placing its
elements in the same order as the corresponding elements in
keylistname
. All lists must have the
same dimension.
SortA(
keylistname
,
dependlist1
[
,
dependlist2
,
...
,
dependlist n
]
)
SortD(
keylistname
,
dependlist1
[
,
dependlist2
,
...
,
dependlist n
]
)
Note:
•
In the example, 5 is the first element in
L4
, and 1 is the first element in
L5
. After
SortA(L4,L5)
, 5
becomes the second element of
L4
, and likewise, 1 becomes the second element of
L5
.
•
SortA(
and
SortD(
are the same as
SortA(
and
SortD(
on the
STAT EDIT
menu (Chapter 12).
•
You cannot sort a locked list.
Using dim( to Find List Dimensions
dim(
(dimension) returns the length (number of elements) of
list
.
dim(
list
)
Using dim( to Create a List
You can use
dim(
with
¿
to create a new
listname
with dimension
length
from 1 to 999. The
elements are zeros.
length
!
dim(
listname
)
Using dim( to Redimension a List
You can use
dim
with
¿
to redimension an existing
listname
to dimension
length
from 1 to 999.
•
The elements in the old
listname
that are within the new dimension are not changed.
•
Extra list elements are filled by 0.
•
Elements in the old list that are outside the new dimension are deleted.