Post Reply 
Strange PPL error
05-07-2022, 04:12 PM
Post: #1
Strange PPL error
Hello all,

I am trying to get used to the HP Prime and wrote a very little program in PPL and I am getting a syntax error in line 3. This is the code:

EXPORT CAS2HOME(VALUE)
BEGIN
PRINT(REPLACE(VALUE,"x","X"));
END;

The funny part is it was working before and on my HP Prime simulator it works too, no error message. It stopped working after my HP Prime rebooted because of an error/crash.

What this code should be good for: If I am using formulas in CAS the variable x is lower case but in the HOME environment X should be upper case. This code can be used to replace all lower case x by upper case X and print the new formula. If you now use the copy function you can use paste in the HOME environment and the formula is native HOME.

I am not sure if there is a better way but this is my solution. The best way would be a special paste function from the HP Prime OS.

Hope someone has an idea what is wrong.

Thanks for your help
Find all posts by this user
Quote this message in a reply
05-07-2022, 08:05 PM (This post was last modified: 05-07-2022 08:27 PM by Dobiray.)
Post: #2
RE: Strange PPL error
I have drilled down this issue a little bit more with some strange results. In contrast to the help the program works with the following code:

EXPORT CAS2HOME(VALUE)
BEGIN
PRINT(REPLACE(VALUE;"x";"X"));
END;

Well using the same code on the virtual HP Prime under MacOS a "," is needed in order to get it working. I am a bit puzzled. My real HP Prime is G2 and has the latest official Firmware 20211202 the virtual on MacOS (20200116 v14425).

Does this make sense to anyone? By the way the help says REPLACE(Object1,start,Object2).
Find all posts by this user
Quote this message in a reply
05-07-2022, 09:08 PM
Post: #3
RE: Strange PPL error
What's your decimal point set to, dot or comma?
Find all posts by this user
Quote this message in a reply
05-07-2022, 09:47 PM
Post: #4
RE: Strange PPL error
Thanks Bruce,

on the real HP Prime it is comma, I am German, and on the virtual HP Prime it is still at the default state. Man I hate this stuff. I didn't expect the decimal point to influence my programming syntax :-(. This is the same stupid thing as with CSV files on Windows as a German user.

Many thanks for the tip. It works now.
Find all posts by this user
Quote this message in a reply
05-08-2022, 01:21 AM
Post: #5
RE: Strange PPL error
From page 602 in the users guide:

   

-road
Find all posts by this user
Quote this message in a reply
05-08-2022, 07:52 AM
Post: #6
RE: Strange PPL error
regarding pragma mode,
see also https://www.hpmuseum.org/forum/thread-17...ght=pragma
Find all posts by this user
Quote this message in a reply
05-08-2022, 09:26 AM
Post: #7
RE: Strange PPL error
So I am not alone :-). My learning on the HP Prime keep it in Englisch default that's the way it is working without headache. All other stuff just makes it too complicated to use. Also my Windows Computers are on English default. With this you have the smallest pain.

It is a great forum here and help is very quick! Thanks a lot

I will go also to the HP 48gx forum to learn more about my 48 which I own since 1993 and the HP Prime should replace.
Find all posts by this user
Quote this message in a reply
05-08-2022, 10:55 AM
Post: #8
RE: Strange PPL error
The problem was that we had to make it so "a math teacher could type some program functions in" since that was becoming something in math curriculum in Europe. It was decided that this meant it had to work using the current settings, and be recognizable...

Did not really want to do it, but when the decimal separator was something else, and the numbers suddenly no longer matched, it was decided by the powers that be that the solution was to make it accept 123,456 if you were in a place that uses that.

Not great, we did not particularly want to do it because it made things more complex, but there you go. That is the reason. Smile

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-08-2022, 03:38 PM
Post: #9
RE: Strange PPL error
Hello Tim,

thanks for the answer why it was done like this. I know it from work sometimes you have to do stuff which is not 100% as you would do it. Life and development is always a compromise ;-). Nothing comes for free.
Find all posts by this user
Quote this message in a reply
Post Reply 




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