09-29-2014, 03:44 PM
Post: #1
 Alberto Candel Member Posts: 169 Joined: Dec 2013
I wrote a CAS program that contains the following three lines
Code:
 WHILE DOT([a,b,c],[1,m,m^2])>0 DO m:=m-1; END;
The [Check] soft key reports No errors in the program.

I saved it and run it with no problem. I went back into the program editor and now those three lines are just two:
Code:
 WHILE DOT([a,b,c],[1,m,m^2])>0 DOm:=m-1; END;;
The [Check] soft key now reports Error: Syntax Error. If I edit it to break it into three lines as it was, it reports No errors in program. But the the same happens: it rewrites itself to the two lines after exiting the editor.

Does anyone know how to fix this? Thanks. A.
09-29-2014, 04:14 PM
Post: #2
 Helge Gabert Senior Member Posts: 464 Joined: Dec 2013
RE: about the Prime program editor
I have run into this before, too (many times). Constructs (branching, loop, testing, etc.) get re-written into one line, and spaces get missed - - resulting in errors, when before, the program ran just fine. PPL programs are unaffected, though.

I'm not writing any more CAS programs until these CAS editor problems get fixed. Plus, during a hard reset, all CAS programs get lost!
09-29-2014, 04:24 PM
Post: #3
 Alberto Candel Member Posts: 169 Joined: Dec 2013
RE: about the Prime program editor
Yes, regular program do fine. But CAS programs have better features I think. They allow you to use large integers. I do not know about regular programs, do you?
09-29-2014, 05:23 PM
Post: #4
 Helge Gabert Senior Member Posts: 464 Joined: Dec 2013
RE: about the Prime program editor
Yes, that is a problem - - if you want to use large integers, or easily use CAS functions without awkward re-casting procedures (although on some CAS functions you can just prepend "CAS.function"), then you're stuck.

That is why I hope in the next OS update this will have been taken care of.
09-29-2014, 05:25 PM
Post: #5
 Nigel (UK) Senior Member Posts: 363 Joined: Dec 2013
RE: about the Prime program editor
(09-29-2014 03:44 PM)Alberto Candel Wrote:  Does anyone know how to fix this? Thanks. A.
Putting curly braces {} around the DO-loop code {m:=m-1} seems to work for me (on the emulator). The code still gets re-formatted without the space, but it runs correctly. I don't know if curly braces will have any side effects, though.

Nigel (UK)
09-29-2014, 06:37 PM (This post was last modified: 10-06-2014 12:17 AM by Alberto Candel.)
Post: #6
 Alberto Candel Member Posts: 169 Joined: Dec 2013
RE: about the Prime program editor
(09-29-2014 05:25 PM)Nigel (UK) Wrote:
(09-29-2014 03:44 PM)Alberto Candel Wrote:  Does anyone know how to fix this? Thanks. A.
Putting curly braces {} around the DO-loop code {m:=m-1} seems to work for me (on the emulator). The code still gets re-formatted without the space, but it runs correctly. I don't know if curly braces will have any side effects, though.

Nigel (UK)
Well, thanks. It worked on the Prime. But this is odd: I replaced m:=m-1 with {m:=m-1} as you suggested, and got No errors. After exiting and returning to edit, the Prime had replaced { } by {( )}. Next I removed the { } leaving only the ( ), and this resulted in Syntax Error.
 « Next Oldest | Next Newest »

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