HP Forums
PPL Inconsistency: Storing Functions to Function Variables - 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: PPL Inconsistency: Storing Functions to Function Variables (/thread-19572.html)



PPL Inconsistency: Storing Functions to Function Variables - Eddie W. Shore - 02-18-2023 03:37 PM

I did some work with the HP Prime this week. The PPL and the way things are done at the Home screen are inconsistent. I can use quotes to store functions ( F1:="X^2+1" ) but have to use the QUOTE command in a program. ( F1:=QUOTE(X^2+1) )

Aside, I also found that using STARTAPP at the beginning allows me to use app commands without having to use prefixes first.


RE: PPL Inconsistency: Storing Functions to Function Variables - gehakte_bits - 02-18-2023 07:05 PM

All quoting ways appear to work, even when not in a native app for the variable (F1). Do you have an example?

Code:

//ppl version 14596

// 2023.0218 pretty-prime v0.3b
#pragma mode(separator(.,;) integer(h32))
EXPORT a_b() 
BEGIN 
LOCAL x,y,z ;
  STARTAPP("Triangle_Solver");

  F1:="X^2-4";
  x:=ROOT(F1,X);

  F1:='X^2-4';
  y:=ROOT(F1,X);

  F1:=QUOTE(X^2-4);
  z:=ROOT(F1,X);

  RETURN ({x,y,z});
END;