Quote:
Hello Han:
Thank you for the prompt reply.
func1(x) is a simple mathematical function that uses variables that are declared as local within prog1(). This is what has caused issues - the fact that func1(x) uses variables that are local within prog1() and must have their value passed to func1(x) - and not necessarily x itself.
I will try your recommendations later today.
Cheers,
TomC
If func1(x) is a mathematical function, then you will also need to use the CAS command. If you wish to create a function f(x,y)=x^2-y^2 then you could have:
CAS("f(x,y):=x^2-y^2");
The reason for CAS() is because what you want to create is essentially a CAS object (a mathematical function of, say, 2 variables with which you would like to use later. However, local variables in a program are currently not recognized by CAS. And in fact, the x and y in the code snippet above are in fact not local variables. You can avoid any hassle with the CAS if you can turn your mathematical function into a procedural function:
FUNC1(x,y)
RETURN(x^2-y^2);
END;
This older post might possibly be relevant
Edited: 17 Nov 2013, 7:31 p.m. after one or more responses were posted