Local Variables; Recovering The Last Arguments - HP -28S Manual

Advanced scientific calculator
Hide thumbs Also See for HP-28S:
Table of Contents

Advertisement

Dropping Stack Objects. These commands drop one or more ob-
jects from the stack. The objects remaining on the stack are dropped
to a lower level. Commands preceded by
"n"
require a real-number
argument.
Command
Description
DROP
Drop the object in level 1.
DROP2
Drop the objects in levels 1 and 2.
n DROPN
Drop the objects in levels 1 through
n.
CLEAR
Drop all objects.
Local Variables
In part 1 you wrote a few user functions-programs that define local
variables and use them in a single expression or program. User func-
tions can be included in algebraics, just like built-in functions.
The use of local variables reduces the need for stack manipulations.
When you create local variables, their values are removed from the
stack. You can then refer to them by name instead of finding them on
the stack.
Local variables have applications in addition to user functions. Al-
most all of the programming examples in chapter 28 use local
variables. Of particular interest are "Box Functions" on page 241,
"MULTI (Multiple Execution)" on page 253, "PRESERVE (Save and
Restore Previous Status)" on page 258, and "SORT (Sort a List)" on
page 270.
Recovering the Last Arguments
The HP-28S saves the arguments to the last command executed. De-
pending on the command, one, two, or three objects may be saved. (If
a command takes no arguments, the previous saved arguments are
preserved.) The command LAST returns the saved arguments, each to
the stack level it occupied originally.
19: The Stack
179

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents