Calling sub programs - 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: Calling sub programs (/thread-3529.html) |
Calling sub programs - leprechaun - 04-01-2015 09:59 AM I apologize but apparently I have, still, not understood how calling cas and home programs can call each other.... I have made a cas program to extract the expression from a function. I found great help here:http://www.hpmuseum.org/forum/thread-3516.html Now that is a cas program. I tried to make a normal program that does the same because having my tools in the toolbox instead of variable content feels better. No success. My old friend "unmatched control word" says hello again and again. Well no poblem - i have the cas function that works. I'll use that. I thought. My Goal is to write a wrapper for convenient function plotting. I was inspired by an other thread and don't like the way the prime acts. First start simple. I thought. Show the expression which should be drawn later: Code:
Unmatch control word hello, again. Well I remember Han explaining that when home and cas Exchange data or call functions of the other part, their arguments are resolved if possible and therefore do harm. "pass them as strings" I thought. But I fail, again... I cannot get "f1" from the original parameter. Code:
How do I use my cas-function expression() from a home program. Or in my specific case: how do I deal with it RE: Calling sub programs - leprechaun - 04-01-2015 10:10 AM Or, in other words, if it is the sollution to pass f1 as a string i.e. unevaluated to Expression(), how to achieve that. RE: Calling sub programs - Han - 04-01-2015 03:17 PM It would help if you could explain what args are needed for the CAS function. If you are doing multiple arguments, then the non-CAS function must be defined explicitly in terms of those multiple arguments. I.e. the non-CAS program does not treat multiple arguments as a single "list" like CAS programs unless you literally pass a list of arguments to the non-CAS program in the form {arg1, arg2, ..., argn} RE: Calling sub programs - leprechaun - 04-02-2015 04:46 AM In that case the argument args is a function called by its name. e.g. if f(b):=b^2 then I want to call expression(f) where expression() is a cas program. Expression() Returns the expression of a function. cas programs should Show in the toolbox. I have the Feeling that cas is more powerful than home. In both view and programs. As a result I tend to use the prime almost only in cas mode! I want to get used to it there. Custom programs are tools and you should not Need to have to get to the idea to do in a search in both, Tools and variables if you look for one. RE: Calling sub programs - toml_12953 - 04-02-2015 01:32 PM (04-02-2015 04:46 AM)leprechaun Wrote: cas programs should Show in the toolbox. I have the Feeling that cas is more powerful than home. In both view and programs. As a result I tend to use the prime almost only in cas mode! I want to get used to it there. Custom programs are tools and you should not Need to have to get to the idea to do in a search in both, Tools and variables if you look for one. Ha ha! I'm just the opposite. I need numbers, not symbolics. I spend my time in RPN function mode and programming in HPPL. If CAS were to disappear, I wouldn't miss it a bit. Tom L |