Re: HP Prime : Programming and the Comma Message #5 Posted by Han on 24 Oct 2013, 4:24 p.m., in response to message #1 by Miguel Toro
Quote:
Hi,
I had this little annoyance about programming with the Prime and using Comma as decimal mark. I am used to it and in many countries that is the current decimal separator. All it takes is to put two instructions separated by ";" to have a "Syntax error in program line..." message. So, when comma is set, the calculator find a syntax error after a semi-colon between instructions.
Something as simple as :
EXPORT ONE()
BEGIN
local x;
x:=1;
msgbox(x);
END;
produces a syntax error at the beginning of line 4.
Of course, once a program is compiled without errors, it can run whatever the decimal separator is set. Before debugging and making changes to a program, I go to home setting and change this option and when everything is fine and the program compiles, I return and change it again. A little annoying but feasible.
What I would like to ask, because I did not find anything about it in the manual, is: when comma is the decimal mark, is there other character to be use to finish an instruction that is not the semicolon?
Thanks and regards,
Miguel
It appears the issue is that in comma mode:
"." ==> "," (period is now comma)
"," ==> ";" (comma is now semi-colon)
But ";" is left as-is. So in programs comma(,) mode on,
begin
local x;
x:=1;
msgbox(x);
end;
is likely being interpreted as
begin
local x,x:=1,msgbox(x),end,
in dot(.) mode.
Out of curiosity, is the colon (:) by itself used for anything? Or do many non-USA countries use the semicolon (;) like a comma (,)?
|