Download  Print this page

HP -28S Manual Page 225

Advanced scientific calculator.
Hide thumbs


Here's how this structure works when you execute the program:
1. The IF command simply marks the start of the structure.
be anywhere before the THEN command.
2. X is evaluated.
3. The number 0 goes on the stack.
4. The command
takes the value of X and the number 0 as
• If the arguments are "not equal",
returns 1.
• If the arguments are
"not equal",
5. The command THEN takes 1 or 0 as its argument.
• If its argument is 1, THEN evaluates the program up to ELSE
:x: ::::
:x: ./).
• If its argument is 0, THEN evaluates the program from ELSE
to END (namely 1).
6. Program execution continues after the END command.
Before continuing with specifics about conditional structures, here's
some general information about program structures.
Program-Structure Commands. The commands IF, THEN, ELSE,
and END are examples of
program-structure commands.
The order and
meaning of these commands are similar to their use in English. You
can't use program-structure commands as flexibly as other commands;
they work only in the combinations described in this chapter.
Test Functions and Commands. The function
is called a
Given two numbers,
returns 1 or 0, indicating whether the
test is true or false. Other test functions are
<, ;.,
member that
is used for equations, not to test equality.) Given
symbolic arguments, test functions return a symbolic result.
There are also test commands that always return 1 or O. For example,
the test command SAME is similar to
= =,
but it simply tests whether
the two objects are identical. Additional test commands are available
for working with flags (described next). For more information about
test functions and commands, see "PROGRAM TEST' in the Refer-
ence Manual.
26: Program Structures


Table of Contents

   Also See for HP HP-28S

   Related Manuals for HP HP-28S

Comments to this Manuals

Symbols: 0
Latest comments: