HP Forums
New's Software for HP Prime does not allow Cesar program to run - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: New's Software for HP Prime does not allow Cesar program to run (/thread-14746.html)



New's Software for HP Prime does not allow Cesar program to run - tom234 - 03-30-2020 04:45 AM

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?


RE: New's Software for HP Prime does not allow Cesar program to run - Tyann - 03-30-2020 06:38 AM

(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.


RE: New's Software for HP Prime does not allow Cesar program to run - tom234 - 03-30-2020 01:06 PM

(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.


RE: New's Software for HP Prime does not allow Cesar program to run - roadrunner - 03-30-2020 01:44 PM

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


RE: New's Software for HP Prime does not allow Cesar program to run - tom234 - 03-30-2020 04:20 PM

http://www.hp-prime.de/files/composite_file/file/55-55-english-hp-prime-127-pages_m.pdf

then go to cesar pg 48


RE: New's Software for HP Prime does not allow Cesar program to run - rprosperi - 03-30-2020 08:19 PM

(03-30-2020 04:20 PM)tom234 Wrote:  http://www.hp-prime.de/files/composite_file/file/55-55-english-hp-prime-127-pages_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.


RE: New's Software for HP Prime does not allow Cesar program to run - Tim Wessman - 03-31-2020 05:56 AM

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...