HP Forums
Strange behavior related to the decimal point / comma ¿Bug? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Strange behavior related to the decimal point / comma ¿Bug? (/thread-7010.html)



Strange behavior related to the decimal point / comma ¿Bug? - JoseL - 10-10-2016 11:57 AM

Hi,

I have noticed a strange behavior related to the decimal point / comma.

For example..... This simple programm:

EXPORT Test()
BEGIN
LOCAL Vx,Vy,Vz ;
FOR N FROM 1 TO 6 DO
Vx:=N;
Vy:=Vx*3;
Vz:=Vx+Vy;
MSGBOX ("Vz= " + Vz );
END;
END;

If you have in Home Settings - Digit Grouping:123,456.789
The program pass ok the Check.
No errors in the program.

But if you have in Home Setting - Digit Grouping:123.456,789
Then the program does not pass the Check.
Syntax Error in line: LOCAL Vx,Vy,Vz ;

The same applies to other lines where the comma is present.

Thanks


RE: Strange behavior related to the decimal point / comma ¿Bug? - primer - 10-10-2016 01:24 PM

you have to add #pragma (usually on top of your program)
this can be done with shift-menu.
place the pragma when yo ucan compile the program (Digit Grouping:123,456.789)

after that, the your program will works in any mode.


RE: Strange behavior related to the decimal point / comma ¿Bug? - Tim Wessman - 10-10-2016 02:37 PM

(10-10-2016 11:57 AM)JoseL Wrote:  Syntax Error in line: LOCAL Vx,Vy,Vz ;

The same applies to other lines where the comma is present.

This is correct behavior. In that mode , is not used for separating arguments in this mode so the source is incorrect.


RE: Strange behavior related to the decimal point / comma ¿Bug? - JoseL - 10-10-2016 06:05 PM

OK.
Thanks.