Post Reply 
point, comma, semicolon confusion
02-29-2020, 09:25 AM (This post was last modified: 02-29-2020 09:29 AM by StephanP.)
Post: #1
point, comma, semicolon confusion
While testing out the code kindly provided by another user, I stumbled onto the following confusion:

1. The code as provided ran just fine on the emulator on my desktop PC
2. The same code would not run on my laptop, nor my HP Prime device

After some investigation I learned the following:
1. I had to replace all delimiter comma's in the code for semicolons
2. I had to replace one decimal point for a decimal comma

Now, where does all this come from?
1. Changing the language setting in the emulator or the device does not make a difference
2. While entering parameters to the standard function NORMALD_CDF(), pressing the comma key actually gives me a semicolon (The Help function tells me to use comma's (?))
3. Calculating decimal numbers is giving me comma's on the screen.

Now, this last one could be tracked back to one of the personal settings: Number Format

For Program Code all this confusion can be quite a bother and actually provides a barrier in sharing and reusing programs.
- So, is this in fact a bug?
- Shouldn't the programming environment be robust wrt personal number format settings?
- And where or when did the delimiter comma change into a semicolon?

Let me add my data:
- Software version: 2.1.14433 (2020 01 21)
- Hardware version: D
- CAS version: 1.5.0
- Serial number: skip
- OS: V2.060.650
Find all posts by this user
Quote this message in a reply
02-29-2020, 09:38 AM
Post: #2
RE: point, comma, semicolon confusion
For that reason we have #pragma, which allows programs to be passed between different calculators with custom configurations.
In the program press Menu/Insert #pragm

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
02-29-2020, 09:58 AM
Post: #3
RE: point, comma, semicolon confusion
Thank you for that tip.

I actually went back to the emulator on my desptop PC (where the code runs) and changed its Number Format to a decimal comma.
From that point the program did not run anymore.
So the Number Format definitely seems the cuplrit here.

Following your suggestion I edited the program, inserting the #pragma
Code:
#pragma mode( separator(,;;) Integer(h32) )

The syntax error remains, pointing at the first separator comma.
Should I have changed something in the #pragma command?
Find all posts by this user
Quote this message in a reply
02-29-2020, 10:06 AM
Post: #4
RE: point, comma, semicolon confusion
HA!
Inserting the #pragma is also dependant upon the current Number Format setting of the device!

So,
1. FIRST reset the Number Format to standard decimal point 123,456.789
2. THEN insert the #pragma

The #pragma now becomes:
Code:
#pragma mode ( separator(.,;) integer (h32) )

And now it works.
Thanks
Find all posts by this user
Quote this message in a reply
03-03-2020, 07:55 AM
Post: #5
RE: point, comma, semicolon confusion
Hello,

Yep, you got it...

Although it is nice to be able to use one native "separator", it, unfortunately, only works well when you only talk to your own group :-(

Prime does have a number format to make it easier to do simple math in your idiom...

However, when programming it becomes much more complicated as, traditionally, characters such as ',' or ';' already have well defined use... causing conflicts...

Some efforts have been made to allow coma folks (I am one of the BTW) to program in coma mode, BUT they are limitations

Similarly in the CAS, which is in fact a scripting language, does not support coma mode at all...

The #pragma directive was created to allow program to be made compatible...

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
03-03-2020, 06:05 PM
Post: #6
RE: point, comma, semicolon confusion
(03-03-2020 07:55 AM)cyrille de brébisson Wrote:  Some efforts have been made to allow coma folks (I am one of the BTW) to program in coma mode, BUT they are limitations

Similarly in the CAS, which is in fact a scripting language, does not support coma mode at all...

Err... "Coma" means the same as in French. I think you mean "comma" (virgule) ? Big Grin

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
03-04-2020, 07:52 AM
Post: #7
RE: point, comma, semicolon confusion
Hello,

Coma (english) = virgule (french)...

When I created the current Prime "Digit grouping" display system, I discovered how messed up the situation was word wide..

'.' vs ',' is just the tip of the iceberg...
Some countries group by 3 digits, some by 4, some by 3, then groups of 2, some have a separator on the top (switzerland), some use different notations depending on the context (financial, non financial)...

Some expect to enter the data in the same format as they see it, some expect to enter the data in a way, but see it in another....

All in all, a programmer's nightmare!

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
03-04-2020, 08:07 AM
Post: #8
RE: point, comma, semicolon confusion
(03-04-2020 07:52 AM)cyrille de brébisson Wrote:  Coma (english) = virgule (french)...

Nope.

Coma (English) = coma (français)

Comma (English) = virgule (français) Smile

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
03-04-2020, 03:26 PM
Post: #9
RE: point, comma, semicolon confusion
This folks is a best case scenario...

A Frenchman that speaks English arguing with an Englishman that speak French, debating a French / English translation.

Lets get some seats and watch... Wink

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-05-2020, 12:35 AM
Post: #10
RE: point, comma, semicolon confusion
… with the added value that both coma mode and comma mode are relevant, unrelated, topics for the Prime Smile

Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot
Casio, Rockwell 18R
Find all posts by this user
Quote this message in a reply
03-05-2020, 02:05 AM
Post: #11
RE: point, comma, semicolon confusion
(03-04-2020 03:26 PM)rprosperi Wrote:  This folks is a best case scenario...

A Frenchman that speaks English arguing with an Englishman that speak French, debating a French / English translation.

Lets get some seats and watch... Wink

I'll bring the popcorn (or is that le pop corn?) Big Grin

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
03-05-2020, 07:15 AM
Post: #12
RE: point, comma, semicolon confusion
Hello,

>A Frenchman that speaks English arguing with an Englishman that speak French, debating a French / English translation.

Actually, the problem here is not about "speaking" French or English, but writing them :-) which is, unfortunately not my strongest suit...
Thanks for pointing it out...

>I'll bring the popcorn (or is that le pop corn?)
Sure, as long as it's sugary... French pop corn is not salted (well, you now do find salted pop corn but this is a relatively recent import)...

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
03-05-2020, 11:38 AM
Post: #13
RE: point, comma, semicolon confusion
(03-05-2020 12:35 AM)cdmackay Wrote:  … with the added value that both coma mode and comma mode are relevant, unrelated, topics for the Prime Smile

I think one of my students was in coma mode just today in class. Big Grin
Find all posts by this user
Quote this message in a reply
03-05-2020, 11:02 PM
Post: #14
RE: point, comma, semicolon confusion
(03-05-2020 07:15 AM)cyrille de brébisson Wrote:  Hello,

X

>I'll bring the popcorn (or is that le pop corn?)
Sure, as long as it's sugary... French pop corn is not salted (well, you now do find salted pop corn but this is a relatively recent import)...

Cyrille

Past times that I visited France they offered me no sweet popcorns, but fresh croissants ?

Before MetaKernel I never thought of France & Math at the same time. Now I envy French because of Prime, Parisse, et Popcorn because they all are sweet!
Find all posts by this user
Quote this message in a reply
03-06-2020, 12:59 AM
Post: #15
RE: point, comma, semicolon confusion
(03-05-2020 11:02 PM)CyberAngel Wrote:  Before MetaKernel I never thought of France & Math at the same time. Now I envy French because of Prime, Parisse, et Popcorn because they all are sweet!

Yum! MetaKernels of pop corn!

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
03-06-2020, 02:17 AM
Post: #16
RE: point, comma, semicolon confusion
(03-05-2020 11:02 PM)CyberAngel Wrote:  Before MetaKernel I never thought of France & Math at the same time. Now I envy French because of Prime, Parisse, et Popcorn because they all are sweet!

(Pssst... you forgot Cyrille, even if it doesn't begin with P...)

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-06-2020, 05:53 PM
Post: #17
RE: point, comma, semicolon confusion
(03-06-2020 02:17 AM)rprosperi Wrote:  
(03-05-2020 11:02 PM)CyberAngel Wrote:  Before MetaKernel I never thought of France & Math at the same time. Now I envy French because of Prime, Parisse, et Popcorn because they all are sweet!

(Pssst... you forgot Cyrille, even if it doesn't begin with P...)

Brébisson, Bernard, Bastille, Bernadotte, barbe à queue
Find all posts by this user
Quote this message in a reply
03-06-2020, 08:39 PM
Post: #18
RE: point, comma, semicolon confusion
Brigitte Bardot !!!

— Dirk Hartland
Find all posts by this user
Quote this message in a reply
03-06-2020, 09:56 PM
Post: #19
RE: point, comma, semicolon confusion
(03-06-2020 05:53 PM)CyberAngel Wrote:  
(03-06-2020 02:17 AM)rprosperi Wrote:  (Pssst... you forgot Cyrille, even if it doesn't begin with P...)

Brébisson, Bernard, Bastille, Bernadotte, barbe à queue

Touché Smile

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




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