HP Forums
about the Prime program editor - 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: about the Prime program editor (/thread-2207.html)



about the Prime program editor - Alberto Candel - 09-29-2014 03:44 PM

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.


RE: about the Prime program editor - Helge Gabert - 09-29-2014 04:14 PM

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!


RE: about the Prime program editor - Alberto Candel - 09-29-2014 04:24 PM

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?


RE: about the Prime program editor - Helge Gabert - 09-29-2014 05:23 PM

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.


RE: about the Prime program editor - Nigel (UK) - 09-29-2014 05:25 PM

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


RE: about the Prime program editor - Alberto Candel - 09-29-2014 06:37 PM

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