Appendix A: System Routines — Lists and Matrices
671
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
cmd_sorta
Declaration:
void
cmd_sorta
(EStackIndex
lst_name
)
Category(ies):
Lists and Matrices, Math, Variables
Description:
Sorts in ascending order the list named by
lst_name
and stores the result
back in the same list.
Inputs:
lst_name
— Indexes the name of a list to sort.
Outputs:
None
Assumptions:
None
Side Effects:
May expand expression stack, cause heap compression, or throw an error.
Availability:
On AMS 1.05 and higher.
TI-89 / TI-92 Plus
Differences:
None
See Also: cmd_sortd
Example:
This example creates a list in L4. Note that this by-passes the normal
routines to tokenize symbol names (
TokenizeName
or
TokenizeSymName
) which should normally be used. The list is then
sorted both in ascending and then descending order.
EStackIndex vName;
push_quantum( END_TAG ); /* executing commands requires this */
push_zstr( "l4" ); /* pushes STR_DATA_TAG also */
vName = top_estack - 1; /* names do not need STR_DATA_TAG so skip it */
push_quantum(END_TAG); push_Float(2.0);
push_Float(-5.1); push_Float(8.0);
push_quantum(LIST_TAG);
VarStore( vName, STOF_ESI, 0, top_estack );
cmd_sorta( vName );
cmd_sortd( vName );