beautypg.com

Element position in the list, Head and tail functions, The seq function – HP 48gII User Manual

Page 266

background image

Page 8-11

Functions GETI and PUTI, also available in sub-menu PRG/ ELEMENTS/, can
also be used to extract and place elements in a list. These two functions,
however, are useful mainly in programming. Function GETI uses the same
arguments as GET and returns the list, the element location plus one, and the
element at the location requested. Function PUTI uses the same arguments as
GET and returns the list and the list size.

Element position in the list

To determine the position of an element in a list use function POS having the
list and the element of interest as arguments. For example,

HEAD and TAIL functions

The HEAD function extracts the first element in the list. The TAIL function
removes the first element of a list, returning the remaining list. Some examples
are shown next:

The SEQ function

Item 2. PROCEDURES.. in the PRG/LIST menu contains the following functions
that can be used to operate on lists.


Functions REVLIST and SORT were introduced earlier as part of the MTH/LIST
menu. Functions DOLIST, DOSUBS, NSUB, ENDSUB, and STREAM, are
designed as programming functions for operating lists in RPN mode. Function

This manual is related to the following products: