Download  Print this page

HP -28S Manual Page 261

Advanced scientific calculator.
Hide thumbs

Advertisement

To maintain execution if an error occurs, the
R
~
B command is
placed inside an IFERR clause. Because no action is required when
an error occurs, the THEN clause contains no commands.
• Enabling LAST. In case an error occurs, LAST must be enabled to
return the argument to the stack. BDISP sets flag 31 to pro-
grammatically enable the LAST recovery feature.
• FOR ... NEXT loop (definite loop with counter). BDISP executes a
loop from 1 to 4, each time displaying
n
in a different base on a
different line.
The loop counter (named
j
in this program) is a local variable. It's
created by the FOR ... NEXT program structure (rather than by a
~
command) and it's automatically incremented by NEXT.
• Subprograms. BDISP demonstrates three uses for subprograms.
1. BDISP contains a main subprogram and a call to PRESERVE.
The main subprogram goes on the stack and is evaluated by
PRESERVE.
2. When BDISP creates a local variable for n, the defining pro-
gram is a subprogram.
3. There are four subprograms that "customize" the action of the
loop. Each subprogram contains a command to change the bi-
nary base, and each iteration of the loop executes one of these
subprograms.
Required Programs:
• PAD (page 257) expands a string to 23 characters so that DISP
shows it right-justified.
• PRESERVE (page 258) stores the current status, executes the main
subprograms and restores the status.
260
28: Programming Examples

Advertisement

Table of Contents

   Also See for HP HP-28S

   Related Manuals for HP HP-28S

Comments to this Manuals

Symbols: 0
Latest comments: