How to store value into variable which is as value of another variable?
|
12-11-2015, 08:15 AM
Post: #1
|
|||
|
|||
How to store value into variable which is as value of another variable?
I am not sure if I can explain it understandably...
I cannot store value into variable directly because I don't know its name. But I know that its name is stored in other known variable. For example: I have something like this: L1(1):="VarNameChoosenByUserViaInput"; I can view value stored in VarNameChoosenByUserViaInput with EXPR(L1(1)), but how I can change value in that variable via L1(1) indirectly? Thanks for any advice. Prime G2, 15C CE |
|||
12-11-2015, 08:27 AM
(This post was last modified: 12-11-2015 08:59 AM by Didier Lachieze.)
Post: #2
|
|||
|
|||
RE: How to store value into variable which is as value of another variable?
(12-11-2015 08:15 AM)chromos Wrote: I have something like this: L1(1):="VarNameChoosenByUserViaInput"; This should work : EXPR(L1(1)+":="+STRING(value)) or : EVAL(L1(1):=value) |
|||
12-11-2015, 09:21 AM
Post: #3
|
|||
|
|||
RE: How to store value into variable which is as value of another variable?
Thank you very much, Didier, first example works.
Second example doesn't - it changes variable L1(1) and not variable inside L1(1). Prime G2, 15C CE |
|||
12-11-2015, 01:07 PM
Post: #4
|
|||
|
|||
RE: How to store value into variable which is as value of another variable?
(12-11-2015 09:21 AM)chromos Wrote: Second example doesn't - it changes variable L1(1) and not variable inside L1(1).Yes, you're right.. Regarding the first example, a few comments:
|
|||
12-11-2015, 10:53 PM
Post: #5
|
|||
|
|||
RE: How to store value into variable which is as value of another variable?
Thank you, Didier.
Prime G2, 15C CE |
|||
12-12-2015, 03:47 AM
Post: #6
|
|||
|
|||
RE: How to store value into variable which is as value of another variable?
I think what you are asking is known as indirect addressing.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)