Program Structures; Local-Variable Structure - HP -28S Manual

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

Advertisement

26
Program Structures
Many programs are equivalent to a series of immediate-execute key-
board computations. Objects go on the stack and commands are
executed, producing the desired result. These programs are simply a
record of the objects and commands, written in the same order as you
would execute them from the keyboard. However, there are features
you can use in programs that go beyond simple keystrokes.
For example, in part 1 you wrote programs that created local vari-
ables. The special command
-t,
followed by one or more names,
followed by a procedure, is called a
local-variable structure.
You can't
execute the command
-t
from the keyboard; it must appear in the
same program as the names and procedure that constitute the entire
program structure.
This chapter first reviews the local-variable structure.
It
then describes
additional program structures that conduct tests and modify program
execution based on the result. All commands for these program struc-
tures appear in the PROGRAM BRANCH menu. Be sure to read the
first example in "Conditional Structures" on page 223, which intro-
duces concepts used in the remainder of the chapter.
Local-Variable Structure
In part 1 you wrote several user functions, which are the most impor-
tant application of the local-variable structure. There are two
requirements for user functions. They must:
• Explicitly indicate their arguments .
• Return exactly one result.
222
26: Program Structures

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents