Post Reply 
{ Vars List} how to store a value in one var of the list ?
02-06-2014, 02:07 PM
Post: #5
RE: { Vars List} how to store a value in one var of the list ?
(02-05-2014 03:06 PM)OldHPUser Wrote:  What about

#{"V1","V2","V3"}(2):=88

?

This is very easy...

Best greetings OldHPUser

OK, but there are only 3 vars, and if user enter more eqs we will need more vars.

The best solutions is create a list of vars dynamic (for n eqs entered by user):
LOCAL uj;
uj:={};
FOR I FROM 1 TO n DO
uj(I):=EXPR("'U"+I+"'");
END;

To store values we only need to do
EXPR(uj(index)+":="+value);

now You can evaluate eq var that has stored algebraic expression like 'U1+U2-..T*U5'
AnyVar:=approx(eq)

Best regards!!
jose
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: { Vars List} how to store a value in one var of the list ? - josephec - 02-06-2014 02:07 PM



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