How to make your Prime programs not dependent o...

Published on by

How to make your Prime programs not dependent of the HP Prime number settings


There is an undocumented function in HP Prime, very useful for us Central Europeans that insist on decimal comma instead of decimal point; and that had to move to decimal point if we wanted to be able to write programs that compile in all circumstances.

the line syntax is


#pragma mode( separator(.,;) integer(h64) )

This is telling the parser that, no matter what the calculator status is, you’re doing the programming with the following convention:

  • Decimal point (.)
  • Argument separator (,)
  • command separator (;)
  • integer type: 64 bit

To insert the PRAGMA, while in program editor, press “Menu” key and “5 insert pragma”. It has to be put before the start of any program, or it will give a syntax error.

You can now test your programs with European and American conventions in the Home settings, and see what happens!

Comments: 0
More about: HP prime, pragma

Only registered users may post comments.
Sign in and post comment Register now