Programming
437
26
Programming
This chapter describes how to program the HP Prime. In
this chapter you’ll learn about:
•
programming commands
•
writing functions in programs
•
using variables in programs
•
executing programs
•
debugging programs
•
creating programs for building custom apps
•
sending a program to another HP Prime
HP Prime
Programs
An HP Prime program contains a sequence of commands
that execute automatically to perform a task.
Command
Structure
Commands are separated by a semicolon ( ; ).
Commands that take multiple arguments have those
arguments enclosed in parentheses and separated by a
comma( , ). For example,
PIXON
(
xposition
,
yposition
);
Sometimes, arguments to a command are optional. If an
argument is omitted, a default value is used in its place. In
the case of the PIXON command, a third argument could
be used that specifies the color of the pixel:
PIXON
(
xposition
,
yposition
[,
color
]);
The last argument indicates which of four colors to use
when lighting up the pixel. Here, the default value is 0
(black). In this manual, optional arguments to commands
appear inside square brackets, as shown above. In the
PIXON
example, a graphics variable (G) could be
specified as the first argument. The default is G0, which
always contains the currently displayed screen. Thus, the
full syntax for the PIXON command is:
Summary of Contents for NW280-200X
Page 1: ...HP Prime Graphing Calculator User Guide ...
Page 4: ......
Page 56: ...50 Reverse Polish Notation RPN ...
Page 64: ...58 Computer algebra system CAS ...
Page 107: ...An introduction to HP apps 101 ...
Page 108: ...102 An introduction to HP apps ...
Page 188: ...182 Spreadsheet these variables is provided in chapter 21 Variables beginning on page 373 ...
Page 220: ...214 Statistics 2Var app ...
Page 252: ...246 Linear Solver app ...
Page 258: ...252 Parametric app ...
Page 268: ...262 Sequence app ...
Page 404: ...398 Units and constants ...
Page 416: ...410 Lists ...
Page 442: ...436 Notes and Info ...
Page 532: ...526 Limiting functionality ...
Page 536: ...530 ...
Page 540: ...534 ...