HP 40gs User Manual page 366

Graphing calculator
Hide thumbs Also See for 40gs:
Table of Contents

Advertisement

hp40g+.book Page 18 Friday, December 9, 2005 1:03 AM
IF... THEN... ELSE...
END
CASE...END
IFERR...
THEN...
ELSE...
END...
21-18
Example
1 A :
IF A==1
THEN MSGBOX " A EQUALS 1" :
END:
Executes the true-clause sequence of commands if the test-
clause is true, or the false-clause sequence of commands
if the test-clause is false.
IF test-clause
THEN true-clause ELSE false-clause END
Example
1 A :
IF A==1 THEN
MSGBOX "A EQUALS 1" :
ELSE
MSGBOX "A IS NOT EQUAL TO 1" :
A+1 A :
END:
Executes a series of test-clause commands that execute
the appropriate true-clause sequence of commands. Its
syntax is:
CASE
IF test-clause
THEN true-clause
1
IF test-clause
THEN true-clause
2
.
.
.
IF test-clause
THEN true-clause
n
END:
When CASE is executed, test-clause
test is true, true-clause
is executed, and execution skips
1
to END. If test-clause
if false, execution proceeds to test-
1
clause
. Execution with the CASE structure continues until
2
a true-clause is executed (or until all the test-clauses
evaluate to false).
Many conditions are automatically recognized by the HP
40gs as error conditions and are automatically treated as
errors in programs.
END
1
END
2
END
n
is evaluated. If the
1
Programming

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents