CASCMD

Type: Command

Description: Displays a list of CAS operations. Selecting one with OK displays a description, related operations, an example of the operation, and the option to copy the example to the command line. More details are given in Appendix C and Appendix H of the User’s Guide. If level 1 of the stack contains a string, the list of CAS operations will be displayed beginning at this point.

Access:

Catalog, …µ, or tools IL

 

See also:

HELP

 

CASE

Command

 

Type:

 

Description:

CASE Conditional Structure Command: Starts CASE … END conditional structure.

 

The CASE … END structure executes a series of cases (tests). The first test that returns a true

 

result causes execution of the corresponding true-clause, ending the CASE … END structure. A

 

default clause can also be included: this clause executes if all tests evaluate to false. The CASE

 

command is available in RPN programming only. You cannot use it in algebraic programming.

 

The CASE … END structure has this syntax:

 

CASE

 

 

test-clause1THEN true-clause1END

 

 

test-clause2THEN true-clause2END

 

 

.

 

 

.

 

 

test-clausenTHEN true-clausenEND

 

 

default-clause (optional)

 

 

END

 

 

When CASE executes, test-clause1is evaluated. If the test is true, true-clause1executes, then

 

execution skips to END. If test-clause1is false, test-clause2executes. Execution within the CASE

 

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

 

the default clause is included, it executes if all test clauses evaluate to false.

Access:

BRCH CASE

( °is the left-shift of the Nkey).

Input/Output:

Level 1/Argument 1

Level 1/Item 1

 

 

CASE

THEN

T/F

END

END

 

 

Example: The following program takes a numeric argument from the stack:

if the argument is negative, it is added to itself

if the argument is positive, it is negated

if the argument is zero, the program aborts

« → X « CASE

'X>0' THEN X NEG END 'X<0' THEN X DUP + END 'X==0' THEN 0 DOERR END END » »

See also: END, IF, IFERR, THEN

3-32 Full Command and Function Reference