PDude Honor Student
Honor Student
2 1 0 1
Message 1 of 6
800
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

HP Prime G2

Hi.

 

I am trying to understand how to program on the HP Prime, but I am a bit baffled with the following. 

I am just trying to run some examples provided in the doc or in the calculator itself without changes (example program offered when creating a new one).

Some of them are referring to variables Xmin, Xmax etc , and depending on the context (if I have run some drawing apps  before or not , or if I cleared the contents of another app), either 

- All goes well 

- Or the editor signals a syntax error when leaving with the  Esc key,  and then the program manager refuses to run the app. 

 

Am I missing something?

 

For example (to replicate the same problem on an emulator on PC):

- Shift - 1 to go to Program section

- Click new - in the Example menu, choose Demo_FILLPOLY

- You land in the editor. Click escape to leave. HP verifies the syntax and claims "syntax error in program line 8".

 

Line 8 is:

Xmin := -15.9; Xmax := 15.9; Ymin := -10.9; Ymax = 10.9; // some comment

 

I would not have expected a manufacturer provided example program to be rejected as having a "syntax error". What I am supposed to do to make the example program work?

Tags (1)
5 REPLIES 5
HP Support Agent
HP Support Agent
6578 6567 214 279
Message 2 of 6
719
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

@PDude
Thank you for posting on the HP Support Community.


If your HP Prime calculator stops responding for any reason, first verify that the batteries are sufficiently charged. If the calculator still does not respond, press and hold O while pressing @ to reset the calculator. If the calculator still does not respond, insert a pin into the reset hole on the back of the calculator and press lightly. Click here for more HP Prime Graphing Calculator Quick Start Guide

 

To reset a field to its default value, move the cursor to that field and press \. To reset all fields to their default values, press S& (Clear). Note that the reset options are available on all screens that show settings (not just the Home Settings screen). If settings are spread over more than one page, pressing S& (Clear) resets only the settings on the page that is currently displayed. To return to Home view, press H. Note that the CAS has its own settings

 

 

Hope this helps! Keep me posted for further assistance.
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.

ECHO_LAKE
I am an HP Employee

Grad Student Grad Student
Grad Student
190 189 34 64
Message 3 of 6
702
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

Hello,

 

Sorry about that...

 

XMin and XMax are APP variables. Not every app has them because not every app has a need for a cartesian graphical screen.

 

This docuement does explain quite a lot of what is happening on Prime with variables and their accessibility.

 

Cyrille

I am an HP Employee
Tags (1)
PhD Student PhD Student
PhD Student
694 692 110 161
Message 4 of 6
669
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

And as to why it "does not always work", if you have a currently open application that does NOT have a graphing view associated with it, the application may not have Xmin and so on defined.

 

Switch to "function app", "parametric" or so on and go into your source again. It will work this time.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
Distinguished Professor
Distinguished Professor
3379 3317 159 493
Message 5 of 6
656
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

Hi!, @PDude :

See, if this example from Eddie Shore, clarify your doubt ... https://www.youtube.com/watch?v=ArdXnE2b6RQ


You're Welcome !.
Best wishes and regards.
@Maké (Voluntary and "ad honorem").
Click the White thumb to say thanks.
Please, mark Accept As Solution if it solves your problem.
PD : The experience is like a comb. It will not do you any good, if you are bald.
A short demonstration of the FILLPOLY command for the HP Prime graphing calculator. Syntax: Cartesian Version: FILLPOLY(points, color, alpha*) Pixel Version: FILLPOLY_P(points, color, alpha*) points: {x1, y1, x2, y2, ... ,x_n, y_n} color: either #RRGGBBh or RGB(r,g,b) alpha: From 0 (transparent) ...
PDude Honor Student
Honor Student
2 1 0 1
Message 6 of 6
641
Flag Post
HP Recommended

Solved!

Default app variables Xmin, Xmax etc randomly available

OK. So from the document provided by Cyrille, the variable name context resolution includes looking up configuration variables of a "current open App". That App's name actually is visible on the top of the program List when when clicking Shift+1 [Program].

 

If indeed I select spreadsheet as the current App, that App has no graphical display, so defines no variables such as Xmin, Xmax, etc. And indeed, if I then try to run the program, the location referring to Xmin/Xmax throws a syntax error.

 

Is there a way to avoid the compilation and execution of a program being dependent on a "current App" setting.

 

I was actually assuming that the following line of code in the program:

 

StartApp("Function")

would force a reference to that App. That does not seem to be the case.

 

Is there any documentation in the HP programming manual that describes in detail the role of the "current App", and just the fact that its name is display on the top of the program list, as well as on App writing in general?

 

Many thanks.

 

 

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation