Create function by program and store as variable ?
|
09-26-2015, 07:49 PM
Post: #6
|
|||
|
|||
RE: Create function by program and store as variable ?
I managed to create the code from string (passed from non-CAS environment) and could call it from non-CAS function.
#cas mkfun(str):= BEGIN fn:=expr(str); // only global var works END; #end EXPORT MKIT() BEGIN LOCAL fnstr:="(x,y)->BEGIN IF x>2 THEN RETURN(7) END ; RETURN(x); END;"; CAS(mkfun(fnstr)); RETURN CAS.fn(32,1); END; MKIT() will return 7 I need something more convenient |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)