HP Forums
RETURN instruction - 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: RETURN instruction (/thread-5707.html)



RETURN instruction - compsystems - 02-18-2016 04:35 PM

in all the languages I've programmed the RETURN instruction end the function
Why not the case in the language of hpprime?

Code:
#cas
prg1(x,y):=
BEGIN
  a:=seq(x^2,x,1,3);
  return a;
   √(x^2+Y^2);  
END;
#end

prg1(3,4) [ENTER] => [1,4,9] OK & not 5


RE: RETURN instruction - Han - 02-18-2016 05:02 PM

This is a bug. In the meantime, use RETURN instead of return.


RE: RETURN instruction - compsystems - 02-18-2016 05:07 PM

(02-18-2016 05:02 PM)Han Wrote:  This is a bug. In the meantime, use RETURN instead of return.
=[
reserved words, should not be sensitive to case-sensitive, this is a bad programming practice, do not know when to use each instruction
I recommend that this form reconsider the firmware and only operate with out case sensitive

Do you agree?
+1


RE: RETURN instruction - ww63 - 02-19-2016 01:31 PM

Yes, but there are some commands where one is for CAS and the other for HOME environet. They are distinguishable by lower/uppercase.