Labels; Tests - HP RPN SCIENTIFIC WP 34S Owner's Manual

Table of Contents

Advertisement

Running / Stopping programs (R/S) and switching between Programming and Run mode
(P/R), commands for labeling a routine (LBL) or returning from a routine (RTN), and for
loop control (DSE and ISG). See the

Labels

Structuring program memory and jumping around in it is eased by labels you may tag to
any program steps – as known from previous programmable pocket calculators. Your
WP 34S features a full set of alphanumeric program labels as described overleaf.
Furthermore, different programs may be separated by END statements. Think of the
beginning and the end of program memory containing implicit END statements.
See the next page for addressing labels.
Searching labels, however, obeys the rule below. When a command such as XEQ lbl is
encountered, with lbl representing a label of one, two or three characters (such as A, BC,
12, Tst, Pg3, x1µ, etc.), your WP 34S will look for this label using the following method:
1. If lbl is purely numeric or a hotkey, it will be searched forward from the current position
of the program pointer. When an END statement is reached without finding lbl, the
quest will continue right after previous END (so the search will stay in the current
routine). This is the search procedure for local labels. It is as known from the HP-41C.
2. If, however, lbl is an alpha label of up to three characters of arbitrary case (auto-
matically enclosed in ' like 'Ab1'), searching will start at program step 000 and cover
the entire memory in the order RAM, FM, and XROM (see p.
independent of the position of the program pointer. This is the search procedure for
global labels.

Tests

Like keystroke-programmable calculators before, your WP 34S features a set of tests.
Their command names have a trailing '?'. Generally, tests will work as in the HP-42S: they
will return true or false in the dot matrix if called from the keyboard; if called in a
program, they will execute the next program step only if the test is true, else skip that step.
So the general rule reads 'skip if false' (exception: KEY?).
As mentioned above, programs typically end with RTN or END. In running programs, both
statements work very similar and show only subtle differences: a RTN statement
immediately after a test returning false will be skipped – an END will not.
See the
IOP
for more information. All tests are contained in the
Note that there are also commands featuring a trailing '?' but returning numbers (e.g.
BASE?) or codes (e.g. KTP?) instead of true or false only – you will find these commands
in the
catalog
P.FCN.
WP 34S Owner's Manual
IOP
for more about these commands.
Edition 3.1
72
for the latter two),
catalog
TEST.
Page 67 of 211

Advertisement

Table of Contents
loading

Table of Contents