HP Forums
Tips: Declaring symbolic 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: Tips: Declaring symbolic variables (/thread-10095.html)



Tips: Declaring symbolic variables - compsystems - 02-04-2018 04:06 PM

PHP Code:
#cas
fa(x):=
BEGIN
  local y

  return 
x*y// "Unitialized local variable y"
END:;
#end 

fa(z) returns "Unitialized local variable y"

PHP Code:
#cas
fb(x):=
BEGIN
  local y
;  purge(y//  purge = does not contain any object == y as symvar
  
return x*y
END:;
#end 

fb(z) returns y*z

PHP Code:
#cas
fc(x):=
BEGIN
  local y
;  assume(y,symbol); // y as symvar
  
return x*y
END:;
#end 

fc(z) returns y*z

PHP Code:
#cas
fd(x):=
BEGIN
  local y
;  y=assume[expression]; // y as symvar
  
return x*y
END:;
#end 

fd(z) returns y*z