beautypg.com

HP Prime Graphing Wireless Calculator User Manual

Page 288

background image

284

Programming in HP PPL

G can be any of the graphics variables and is optional.
The default is G0, the current graphic.
x1, y1 are optional. The default values represent the top
left of the graphic.
x2, y2 are optional. The default values represent the
bottom right of the graphic.
edgecolor and fillcolor can be any color specified as
#RRGGBB. Both are optional, and fillcolor defaults to
edgecolor if not specified.
To erase a GROB, execute RECT(G). To clear the screen

execute RECT().
When optional arguments are provided in a command
with multiple optional parameters (like RECT), the

arguments provided correspond to the leftmost parameters
first. For example, in the program below, the arguments
40 and 90 in the RECT_P command correspond to x1

and y1. The argument #000000 corresponds to

edgecolor, since there is only the one additional
argument. If there had been two additional arguments,
they would have referred to x2 and y2 rather than
edgecolor and fillcolor. The program produces a
rectangle with a black edge and black fill.

EXPORT BOX()
BEGIN
RECT();
RECT_P(40,90,#0

00000);
WAIT;
END;

The program below also uses the RECT_P command. In

this case, the pair of arguments 320 and 240 correspond

to x2 and y2. The program produces are rectangle with

a black edge and a red fill.