HP Forums
Check and Home Settings - 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: Check and Home Settings (/thread-4163.html)



Check and Home Settings - Pierre F8APV - 06-16-2015 03:28 AM

Hello everybody.
I see a strange behavior of "Check" key when I set some value to Digit Grouping in home settings...
For example, if Digit grouping is 123456,789, Check give syntax error with this test program :
(Cursor position just after the 'a' line 4)

If I set Digit grouping to 123456.789 no error... ?

EXPORT test()
BEGIN
local a;
input({{a,[0],{15,30,0}}});
END;


RE: Check and Home Settings - Didier Lachieze - 06-16-2015 05:11 AM

To make your program compatible with the different digit grouping options you need to insert a pragma statement at the beginning:
  • set the digit grouping to 123456.789
  • position the cursor before EXPORT and press Menu > Insert pragma

Code:
#pragma mode( separator(.,;) integer(h32) )
EXPORT test()
BEGIN
local a;
input({{a,[0],{15,30,0}}});
END;



RE: Check and Home Settings - Pierre F8APV - 06-16-2015 05:45 AM

Hello Didier and thanks !
I didn't know this "#pragma" but, after reading your post, I found some informations and details on it...

http://www.hpmuseum.org/forum/thread-1427.html

Thanks you.


RE: Check and Home Settings - Didier Lachieze - 06-16-2015 07:22 AM

Yes, it’s not well documented but it is a good practice to start any program with a #pragma statement. It avoids troubles if you change your decimal separator later on or if you share your program with someone using different settings.