02-09-2019 10:41 PM - edited 02-10-2019 09:07 AM
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?
Solved! Go to Solution.
02-11-2019 03:59 PM
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.
I am an HP Employee
02-11-2019 12:49 AM
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.
02-12-2019 08:44 PM
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.
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.
02-13-2019 04:11 AM
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.
02-13-2019 08:18 AM
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:
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?