CASE Syntax:

CASE

IF test1 THEN commands1 END;

IF test2 THEN commands2 END;

[DEFAULT commands] END;

Evaluates test1. If true, executes commands1 and ends the CASE. Otherwise, evaluates test2. If true, executes commands2 and ends the CASE. Continues evaluating tests until a true is found. If no true test is found, executes default commands, if provided.

Example:

CASE

IF x < 0 THEN RETURN "negative"; END;

IF x < 1 THEN RETURN "small"; END;

DEFAULT RETURN "large";

END;

IFERR IFERR commands1 THEN commands2 END;

Executes sequence of commands1. If an error occurs during execution of commands1, executes sequence of commands2.

IFERR ELSE IFERR commands1 THEN commands2 ELSE commands3 END;

Executes sequence of commands1. If an error occurs during execution of commands1, executes sequence of commands2. Otherwise, execute sequence of commands3.

Loop

FOR Syntax: FOR var FROM start TO finish DO commands END;

Sets variable var to start, and for as long as this variable is less than or equal to finish, executes the sequence of commands, and then adds 1 (increment) to var.

Programming in HP PPL

529

Page 535
Image 535
HP Prime Graphing NW280AAABA manual Loop, Case, Default commands END