HP Prime - Problem with the decimal separator
10-28-2015, 05:06 AM
Post: #1
 wChris79 Junior Member Posts: 22 Joined: Apr 2015
HP Prime - Problem with the decimal separator
Hello,
I have a problem with the decimal separator. If I use the comma necessary to use the "fracmod ()" the program that contains the function no longer runs it stops on every point of the program, for example, list of variables etc ... And if I uses the period as the separator the program works except the "fracmod ()" which does not run because it forward a number with a comma and not a point.
How to define what functions to work with a point rather than a variable?
10-28-2015, 07:14 AM
Post: #2
 primer Member Posts: 135 Joined: Sep 2015
RE: HP Prime - Problem with the decimal separator
(10-28-2015 05:06 AM)wChris79 Wrote:  Hello,
I have a problem with the decimal separator. If I use the comma necessary to use the "fracmod ()" the program that contains the function no longer runs it stops on every point of the program, for example, list of variables etc ... And if I uses the period as the separator the program works except the "fracmod ()" which does not run because it forward a number with a comma and not a point.
How to define what functions to work with a point rather than a variable?
That's because the program lacks the #pragma line.
this line tells the calculator what are the separators used to built the program (the source)

It can be optained with menu key while editing the program.

What you can do :
Change your configuration to find the one that make this program to works.
Ok, then edit the source and insert pragma at first line.
example :
Code:
#pragma mode( separator(.,;) integer(h32) )
Regards

primer
10-28-2015, 08:15 AM (This post was last modified: 10-28-2015 08:16 AM by wChris79.)
Post: #3
 wChris79 Junior Member Posts: 22 Joined: Apr 2015
RE: HP Prime - Problem with the decimal separator
Excuse me, but where is the menu button in the edit mode of the program and the item 5 "insert pragma"
On the other hand I have a syntax error by inserting exactly your example online
#pragma mode (separator (.,;) integer (h32)) in first line of the program.
10-28-2015, 08:24 AM
Post: #4
 jebem Senior Member Posts: 1,322 Joined: Feb 2014
RE: HP Prime - Problem with the decimal separator

Jose Mesquita

10-28-2015, 10:14 AM
Post: #5
 primer Member Posts: 135 Joined: Sep 2015
RE: HP Prime - Problem with the decimal separator
(10-28-2015 08:15 AM)wChris79 Wrote:  On the other hand I have a syntax error by inserting exactly your example online
#pragma mode (separator (., integer (h32)) in first line of the program.
First, you have a space after "mode", mine does not. same with separator and integer.

Second, separator in my example comes from my settings.
Until I see your program, I can't tell you if it's ok for your program... your program may require something different, that's why I told you to find the right setting and then to insert program from the "menu" key.
Regards.

primer
10-28-2015, 11:31 AM
Post: #6
 Han Senior Member Posts: 1,817 Joined: Dec 2013
RE: HP Prime - Problem with the decimal separator
Don't forget to update the firmware if you have not already done so

Graph 3D | QPI | SolveSys
10-28-2015, 01:09 PM (This post was last modified: 10-28-2015 02:19 PM by wChris79.)
Post: #7
 wChris79 Junior Member Posts: 22 Joined: Apr 2015
RE: HP Prime - Problem with the decimal separator
I can not find the solution.
I tried several combinations.
In settings: the decimal separator is the point.

decimal separator is a point in the program.
parameter separator is a comma in the program.
command separator is a semi in the program.
and integers are 32 bits hexadecimal
Here is my code:

#pragma mode(separator(., integer(h32))
EXPORT TEST2()
BEGIN
LOCAL x, y;
10 -> x;
2015 -> y;
PRINT("TEST ANNEE : " + y + " MOIS : " + x);
END;
10-28-2015, 03:13 PM
Post: #8
 primer Member Posts: 135 Joined: Sep 2015
RE: HP Prime - Problem with the decimal separator
Votre programme fonctionne très bien, j'ai juste modifié "->" en "▶"

Your program does works, I only changed "->" into "▶"

Code:
#pragma mode(separator(.,;) integer(h32)) EXPORT TEST2() BEGIN LOCAL x, y; 10▶x; 2015▶y; PRINT("TEST ANNEE : " + y + " MOIS : " + x); END;

primer
10-28-2015, 06:35 PM
Post: #9
 wChris79 Junior Member Posts: 22 Joined: Apr 2015
RE: HP Prime - Problem with the decimal separator
OK. Thank you very much
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)