HP 48g Graphing Calculator User Manual

Page 417

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

Advertising
background image

it’s automatically evaluated to a number—you don’t need
EVAL.

>NUM or

IF begins the test-clause, which leaves a test result on the stack.

THEN removes the test result from the stack. If the value is nonzero,

the true-clause is executed—otherwise, the false-clause is executed.
After the appropriate clause is executed, execution resumes following

END.

CASE...END

To enter CASE...END in a program:

1. Press (PRG) B R C h C A S E to enter

CASE... riir.\...i;\D...r,.\D.

2. For each additional test-clause, move the cursor after a test-clause

END and press ¡7^ CfiSE to enter THEN...END.

The syntax for the CASE...END structure is:

CASE

test-clausei

H true-clausei END

test-clause^ THEN true-clause

2

END

test-clause^ THEN true-clause^ END

default-clause (optional)

This structure lets you execute a series of test-clause commands, then
execute the appropriate true-clause sequence of commands. The first
test that returns a true result causes execution of the corresponding
true-clause, ending the CASE...END structure. Optionally, you

can include after the last test a default-clause that’s executed if
all the tests evaluate to false. If a test-clause is an algebraic, it’s
automatically evaluated to a number—you don’t need ^NUM or
EVAL.

When CASE is executed, test-clausei is evaluated. If the test is true,
true-clausei is executed, and execution skips to END. If test-clausei is

false, execution proceeds to test-clause

2

. Execution within the CASE

structure continues until a true-clause is executed, or until all the
test-clauses evaluate to false. If a default clause is included and all the

test-clauses evaluate to false, the default clause executes.

29

Programming the HP 48 29-11

Advertising
This manual is related to the following products: