HP Forums
Cas.collect() doesn't work for division expression when it is used in program[SOLVED] - 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: Cas.collect() doesn't work for division expression when it is used in program[SOLVED] (/thread-11007.html)



Cas.collect() doesn't work for division expression when it is used in program[SOLVED] - vvolkan - 07-04-2018 11:00 PM

Hi,
When i use collect() function in cas home screen it works without any problem. When i use collect() in multi command program which i shared in forum, it doesnt work for division expressions. Do you have any idea about the issue? I share screenshot and the code i tried collect() in the screenshot mc() comand.

EXPORT mc(var1)
BEGIN

var1:=collect(var1);

return (var1);

end;


multi command program full code link:
http://www.hpmuseum.org/forum/thread-11004.html


RE: Cas.collect() doesn't work for division expression when it is used in program - parisse - 07-05-2018 04:25 AM

Try with a CAS program (or insure that your expression is eval-ed). / is expected to be evaled to *inv() before any CAS command. If you mix CAS and non CAS execution, the argument of your program might not be evaled.


RE: Cas.collect() doesn't work for division expression when it is used in program - DrD - 07-05-2018 04:51 PM

Did you try it with the various [CAS] simplify settings? {none, minimum, maximum}

-Dale-


RE: Cas.collect() doesn't work for division expression when it is used in program - vvolkan - 07-06-2018 01:26 PM

I have added #cas mode to the code and make the cas.function operations in that part of the program and assigned function results to global variables in that cas part. Lastly i used variable in non-cas part of the program. Thanks for your suggestions. the code something like this:

transfervar;
#cas
mc1(var1):=
BEGIN

transfervar:=eval('collect(var1)');

END;
#end

//Second part of code or another code file:

EXPORT mc2()
BEGIN

return (transfervar);

END;