Owner manual

Branch Commands
A programming structure allows a program to control how it
should execute depending on given conditions or the values
of particular arguments. The HP 38G has two kinds of control
structures:
e Branch structures.
* Loop structures.
Branch structures let a program make a decision based on the
result of one or more tests. Here is a summary of the branch
structures available on the HP 38G. (Unlike the other
programming commands, the control structure commands
work in logical groups. Therefore, the commands are
described together rather than each independently.)
IF...THEN... Executes a sequence of commands in the test<lause only if the
ELSE...END test-clause evaluates to true. Its syntax is:
IF test-clause
THEN true-clause ELSE false-clause END
IF...THEN...ELSE...END executes the true<lause sequence of
commands if the test<lause is true, or the false<lause sequence
of commands if the tesKlause is false.
Exanqple
l^A :
IF A==l
THEN MSGBOX A " EQUALS 1" ;
ELSE MSGBOX A " IS NOT EQUAL TO 1“ :
end:
Programming 8-11