cmd_sortd Function (ROM Call 0x38F)

AMS 1.01 or higher bascmd.h

void cmd_sortd (ESI SymName);

Executes TI-Basic 'SortD' command.

cmd_sortd sorts elements in a TI-Basic list variable in descending order and stores the result back in the same list. The parameter SymName should point to the terminating zero byte or variable tag of the list variable name. It must be on the expression stack, so you cannot pass a result of the SYMSTR macro directly to cmd_sortd. Instead, if you want to sort the list variable named "foo", for example, you should do:

push_expression (SYMSTR ("foo"));
cmd_sortd (top_estack);
This function may cause heap compression and expansion of the expression stack.


Uses: HeapAllocHighThrow, HeapAllocThrow, HeapFree, HeapFreeIndir, HeapLock, HeapUnlock, HLock, remaining_element_count, push_mat_to_list, push_string, ER_catch, ER_success, ER_throwVar, compare_expressions, delete_expression, HToESI, next_expression_index, push_expression, push_quantum, top_estack, compare_numbers, primary_tag_list, push_simplify, DerefSym, QSysProtected, VarRecall, VarStore


See also: cmd_sorta