256 Programming
When assigning a value to a cell in a list, vector, or
matrix, use the  command rather than :=. For example,
the command 73
 L1(5) will put the number 73 into the
5th position of list L1. If you are entering a program using
a calculator emulator running on a computer, then => can
be used as a synonym for
.
Branch
Commands
IF…THEN…END Syntax: IF test THEN command(s) END;
Evaluate test. If test is true (non 0), execute command(s).
Otherwise, nothing happens.
Example:
IF…THEN…ELSE…END Syntax: IF test THEN command(s)1 ELSE command(s)2
END;
Evaluate test. If test is true (non 0), execute command(s)1,
otherwise, execute command(s)2
IFTE Syntax: IFTE(test,true_xpr,false_xpr)
Evaluates test. If test is true (non 0), return true_xpr,
otherwise return false_xpr
IFERR…THEN…END IFERR commands1 THEN commands2 [ELSE
commands3] END;
Executes sequence of commands1. If an error occurs
during execution of commands1, execute sequence of
commands2. Otherwise, execute sequence of
commands3.
CASE…END Syntax:
CASE
IF test1 THEN commands1 END
IF test2 THEN commands2 END
…
[DEFAULT commands]
END;
Evaluates test1. If true, execute commands1 and end the
CASE. Otherwise, evaluate test2
. If true, execute