Post Reply 
How do you assign a global var in a CAS function?
11-06-2017, 08:20 PM (This post was last modified: 11-06-2017 08:22 PM by salvomic.)
Post: #4
RE: How do you assign a global var in a CAS function?
(11-05-2017 11:27 PM)webmasterpdx Wrote:  I did figure this out...

EXPORT MMM:=256;

#cas
TEST(l):=
BEGIN
RETURN MMM*l[3];
END
#end

...but MMM is a Home variable when done this way.
Let's say I want to create a global CAS list, which can be indexed using []. How do I do that from a CAS program?

Export is to use first of the #cas #end or BEGIN END; block, with default values, like:
Code:
export MMM:=[[0,0],[0,0]];

In another part of the program you must use STO (or sto) to store a value in the var exported, like:
Code:
sto({varrow, varcol}, MMM);
not return, that you can use for other purpose...
When you store something, you can also read the variable in another part of the program (or other program)...

Is this your goal?

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How do you assign a global var in a CAS function? - salvomic - 11-06-2017 08:20 PM



User(s) browsing this thread: 1 Guest(s)