Post Reply 
New's Software for HP Prime does not allow Cesar program to run
03-30-2020, 04:45 AM
Post: #1
New's Software for HP Prime does not allow Cesar program to run
Hello,
I used cesar program in HP own sight paper
EXPORT CESAR() BEGIN
local n;
LOCAL S,M,K; ””M;
//The user is asked to enter the encrypted word
INPUT(n,”Insert in quotation marks”,”Encrypted word”); SIZE(n)S;
FOR K FROM 1 TO S DO
//This time we shift by 3 letters backwards M+CHAR(ASC(MID(n,K,1))-3)M;
END; PRINT(M); END;

It worked in last OS but in the new one I get error at ""M;

Can anyone tell me why it works in old OS and not in the new OS?
Find all posts by this user
Quote this message in a reply
03-30-2020, 06:38 AM
Post: #2
RE: New's Software for HP Prime does not allow Cesar program to run
(03-30-2020 04:45 AM)tom234 Wrote:  Hello,
I used cesar program in HP own sight paper
EXPORT CESAR() BEGIN
local n;
LOCAL S,M,K; ””M;
//The user is asked to enter the encrypted word
INPUT(n,”Insert in quotation marks”,”Encrypted word”); SIZE(n)S;
FOR K FROM 1 TO S DO
//This time we shift by 3 letters backwards M+CHAR(ASC(MID(n,K,1))-3)M;
END; PRINT(M); END;

It worked in last OS but in the new one I get error at ""M;

Can anyone tell me why it works in old OS and not in the new OS?

Bonjour
je pense qu'il manque un sto entre "" et M
ainsi qu'à la ligne :
Code:

M+CHAR(ASC(MID(n,K,1))-3)M;
qui devrait être :
Code:
M+CHAR(ASC(MID(n,K,1))-3) sto M;
ou
Code:

M:=M+CHAR(ASC(MID(n,K,1))-3);
Pour la déclaration vous pouvez écrire :
Code:
LOCAL M:="",......;
Espérant avoir aidé.

Hello
I think there's a sto missing between "" and M
as well as the line:
Code:

M+CHAR(ASC(MID(n,K,1))-3)M;
which should be:
Code:
M+CHAR(ASC(MID(n,K,1))-3) sto M;
or
Code:

M:=M+CHAR(ASC(MID(n,K,1))-3);
.
For the declaration you can write :
Code:
LOCAL M:="",....;
Hoping to have helped.

Sorry for my english
Find all posts by this user
Quote this message in a reply
03-30-2020, 01:06 PM
Post: #3
RE: New's Software for HP Prime does not allow Cesar program to run
(03-30-2020 06:38 AM)Tyann Wrote:  
(03-30-2020 04:45 AM)tom234 Wrote:  Hello,
I used cesar program in HP own sight paper
EXPORT CESAR() BEGIN
local n;
LOCAL S,M,K; ””M;
//The user is asked to enter the encrypted word
INPUT(n,”Insert in quotation marks”,”Encrypted word”); SIZE(n)S;
FOR K FROM 1 TO S DO
//This time we shift by 3 letters backwards M+CHAR(ASC(MID(n,K,1))-3)M;
END; PRINT(M); END;

It worked in last OS but in the new one I get error at ""M;

Can anyone tell me why it works in old OS and not in the new OS?

Bonjour
je pense qu'il manque un sto entre "" et M
ainsi qu'à la ligne :
Code:

M+CHAR(ASC(MID(n,K,1))-3)M;
qui devrait être :
Code:
M+CHAR(ASC(MID(n,K,1))-3) sto M;
ou
Code:

M:=M+CHAR(ASC(MID(n,K,1))-3);
Pour la déclaration vous pouvez écrire :
Code:
LOCAL M:="",......;
Espérant avoir aidé.

Hello
I think there's a sto missing between "" and M
as well as the line:
Code:

M+CHAR(ASC(MID(n,K,1))-3)M;
which should be:
Code:
M+CHAR(ASC(MID(n,K,1))-3) sto M;
or
Code:

M:=M+CHAR(ASC(MID(n,K,1))-3);
.
For the declaration you can write :
Code:
LOCAL M:="",....;
Hoping to have helped.

/////

Did you run that code it doesn't work for me? The old OS software knows and can run it but not the new one. New OS has its new syntax problems.
Find all posts by this user
Quote this message in a reply
03-30-2020, 01:44 PM
Post: #4
RE: New's Software for HP Prime does not allow Cesar program to run
There seems to be something wrong with your INPUT statement. I retyped the whole line and made the changes mentioned by Tyann and this runs:

PHP Code:
EXPORT CESER()
BEGIN
 LOCAL n
;
 
LOCAL S,M,K;
 
M:="";

//The user is asked to enter the encrypted word
//INPUT(n,”Insert in quotation marks”,”Encrypted word”); SIZE(n)S;
 
INPUT({{n,[2]}},"Don't insert quotation marks","Encrypted word","","","");
 
S:=SIZE(n);

 FOR 
K FROM 1 TO S DO
//This time we shift by 3 letters backwards
  
M:=M+CHAR(ASC(MID(n,K,1))-3);
 
END;
 PRINT();
 PRINT(
n);
 PRINT(
M);
END

-road
Find all posts by this user
Quote this message in a reply
03-30-2020, 04:20 PM
Post: #5
RE: New's Software for HP Prime does not allow Cesar program to run
http://www.hp-prime.de/files/composite_f...ages_m.pdf

then go to cesar pg 48
Find all posts by this user
Quote this message in a reply
03-30-2020, 08:19 PM
Post: #6
RE: New's Software for HP Prime does not allow Cesar program to run
(03-30-2020 04:20 PM)tom234 Wrote:  http://www.hp-prime.de/files/composite_f...ages_m.pdf

then go to cesar pg 48

That document is nearly 6 years old. The Prime f/w has been updated many times since then, and though I am not certain about this detail, it's likely there was a small adjustment to the allowed syntax and the original version used in that line has been improved, as seen in the slightly adjusted version posted by roadrunner.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-31-2020, 05:56 AM (This post was last modified: 03-31-2020 05:59 AM by Tim Wessman.)
Post: #7
RE: New's Software for HP Prime does not allow Cesar program to run
Most likely syntax that was never supposed to work was made more strict in the checking that came later to avoid problems. Honestly, very little changed from before that was not "broken" in some way. Most of the issues deal with trying to use new features on older units, not the other way around.

The other possibility I see is that the author of the document DID NOT use the correct forward STO arrow character. So if you copied/pasted then the incorrect character was used in the PDF and then sent to the calculator. Hence the lines with STO complaining about issues...

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
Post Reply 




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