HP Forums

Full Version: difference between command1 and command1_p
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm a new on programming so I decided to read the manual but I saw commands that are pretty the same as example blit and blit_p an so on. My question is what are the differences between the one whit and whiPout "_p"
The user guide offers this (Program Commands Page 637):

Drawing

There are 10 built-in graphics variables in the HP Prime, called G0–G9. G0 is always the current screen graphic.
G1 to G9 can be used to store temporary graphic objects (called GROBs for short) when programming applications that use graphics. They are temporary and thus cleared when the calculator turns off.
Twenty-six functions can be used to modify graphics variables. Thirteen of them work with Cartesian coordinates using the Cartesian plane defined in the current app by the variables Xmin, Xmax, Ymin, and Ymax.
The remaining thirteen work with pixel coordinates where the pixel 0,0 is the top left pixel of the GROB, and 320, 240 is the bottom right. Functions in this second set have a _P suffix to the function name.

-Dale-
(04-12-2018 08:05 PM)DrD Wrote: [ -> ]The user guide offers this (Program Commands Page 637):
... the pixel 0, 0 is the top left pixel of the GROB, and 320, 240 is the bottom right. ...

ONE of those pairs must be wrong, since the screen isn't 321 × 241. The same bottom-right coordinates of 320, 240 are also cited on page 642.
(04-13-2018 05:02 AM)Joe Horn Wrote: [ -> ]
(04-12-2018 08:05 PM)DrD Wrote: [ -> ]The user guide offers this (Program Commands Page 637):
... the pixel 0, 0 is the top left pixel of the GROB, and 320, 240 is the bottom right. ...

ONE of those pairs must be wrong, since the screen isn't 321 × 241. The same bottom-right coordinates of 320, 240 are also cited on page 642.

You're right, that's wrong, and that paints a completely different picture on this description. I mean, who would have even thought there would be any errors in the manual?Smile

To the trained eye, as anyone can plainly see, the top left coordinate is (0,0) and the bottom right coordinate is (319,239), totaling (x,y) = (320,240) pixels:

Code:

EXPORT PIX()
BEGIN 
  RECT();
  PIXON_P(0,0,#FF0000h); 
  PIXON_P(319,239,#FF0000h);
  WAIT;
END;

-Dale-
Reference URL's