Post Reply 
syntax error but its from HP Prime Exercises..what up with that?
11-18-2019, 09:52 PM
Post: #1
syntax error but its from HP Prime Exercises..what up with that?
The error is in ""M; dont know why?
anyone know why?


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;
Find all posts by this user
Quote this message in a reply
11-18-2019, 11:45 PM (This post was last modified: 11-18-2019 11:46 PM by pinkman.)
Post: #2
RE: syntax error but its from HP Prime Exercises..what up with that?
Hi,
The arrows (sto) are missing, the quotation marks are not the right ones (maybe because of your PC keyboard), and the INPUT command is used the wrong way to input strings.
Where did you find this example?

Here is my proposed correction:

Code:

EXPORT CESAR()
BEGIN
//local n;
LOCAL N,S,M,K;
""▶M;
//The user is asked to enter the encrypted word
INPUT({{N,[2]}}, "Insert without 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;
Find all posts by this user
Quote this message in a reply
11-18-2019, 11:50 PM
Post: #3
RE: syntax error but its from HP Prime Exercises..what up with that?
I found it in publication:

EXERCISES HP Prime


by:Preparation: MORAVIA Education, a division of MORAVIA Consulting Ltd. http://www.moravia-consulting.com Creation and copyright: Mickaël Nicotera, http://mic.nic.free.fr/
More documents at: http://www.hp-prime.com
Date of issue: 06.2014

The language changed that much since 22014?

thank you.
Find all posts by this user
Quote this message in a reply
11-19-2019, 01:09 AM
Post: #4
RE: syntax error but its from HP Prime Exercises..what up with that?
(11-18-2019 11:50 PM)tom234 Wrote:  I found it in publication:

EXERCISES HP Prime


by:Preparation: MORAVIA Education, a division of MORAVIA Consulting Ltd. http://www.moravia-consulting.com Creation and copyright: Mickaël Nicotera, http://mic.nic.free.fr/
More documents at: http://www.hp-prime.com
Date of issue: 06.2014

The language changed that much since 22014?

thank you.

No, i suspect the font is not embedded/installed and whatever you are viewing with shows nothing for unknown characters.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
11-19-2019, 11:49 AM
Post: #5
RE: syntax error but its from HP Prime Exercises..what up with that?
Your line is see as input in HP Prime for Alegerbra and in other programs like dist2:
INPUT({{N,[2]}}, "Insert without quotation marks", "Encrypted word");
TY
Find all posts by this user
Quote this message in a reply
11-19-2019, 01:03 PM (This post was last modified: 11-19-2019 01:04 PM by tom234.)
Post: #6
RE: syntax error but its from HP Prime Exercises..what up with that?
EXPORT AA()
BEGIN
LOCAL A,L;
L:=[]; (this line has a error inside the box is this syntax out of date?)
REPEAT
REPEAT
A:=GETKEY;
UNTIL A!=-1;
L:=CONCAT(L,A);
UNTIL ISKEYDOWN(48);
RETURN L;
END;



Symbolic computation
and
Mathematics
with
the calculator HP Prime
Renée De Graeve
Lecturer at Grenoble on page 497

Is this texts words out of date with software programing lauguage in use now?
Find all posts by this user
Quote this message in a reply
11-19-2019, 01:28 PM
Post: #7
RE: syntax error but its from HP Prime Exercises..what up with that?
Are only empty lists allowed?

Yes: { }
No: [ ] (empty vectors)
Visit this user's website Find all posts by this user
Quote this message in a reply
11-19-2019, 01:37 PM
Post: #8
RE: syntax error but its from HP Prime Exercises..what up with that?
(11-19-2019 01:28 PM)Eddie W. Shore Wrote:  Are only empty lists allowed?

Yes: { }
No: [ ] (empty vectors)

why would HP allow wrong computer code that does not work in their instruction books?
Find all posts by this user
Quote this message in a reply
11-19-2019, 03:32 PM
Post: #9
RE: syntax error but its from HP Prime Exercises..what up with that?
It is not an HP book nor site. Smile

Talk to the author.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
11-19-2019, 08:18 PM
Post: #10
RE: syntax error but its from HP Prime Exercises..what up with that?
(11-19-2019 03:32 PM)Tim Wessman Wrote:  It is not an HP book nor site. Smile

Talk to the author.

Ty

are there any publications by HP that show the proper syntax for programming language?
Find all posts by this user
Quote this message in a reply
11-19-2019, 08:48 PM (This post was last modified: 11-19-2019 08:51 PM by StephenG1CMZ.)
Post: #11
RE: syntax error but its from HP Prime Exercises..what up with that?
You will find useful information within the user guides and tutorials here (note that not all is official HP) :
https://www.hpmuseum.org/forum/thread-81...ddie+shore

Stephen Lewkowicz (G1CMZ)
ANDROID HP Prime App broken offline on some mobiles
Visit this user's website Find all posts by this user
Quote this message in a reply
11-19-2019, 10:03 PM
Post: #12
RE: syntax error but its from HP Prime Exercises..what up with that?
(11-19-2019 08:18 PM)tom234 Wrote:  are there any publications by HP that show the proper syntax for programming language?

Try also pressing the HELP button, it is really useful.
Find all posts by this user
Quote this message in a reply
11-20-2019, 01:13 AM
Post: #13
RE: syntax error but its from HP Prime Exercises..what up with that?
There are also a lot of built in progam examples in the calculator itself ready to load in and run/study. In the "New" screen when making a program, press "Example" to pick one.

TW

Although I work for the HP calculator group, 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: 1 Guest(s)