Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indirect varible assignment

Status
Not open for further replies.

vtf137

Programmer
Dec 14, 2004
1
US
I am new to REXX, I have a CLIST that did the following :

SET A = VNAME
SET &&A = VALUE
WRITE A = &A
WRITE VNAME = &VNAME

will result in A = VNAME and VNAME = VALUE

Can I or how do I do this in REXX ?

This is just a simple example, the actually CLIST is used to be like an interpreter of commands.

Thanks for any help anyone can offer.



 

"VALUE".

a = "VNAME"
vname = value
say a Value(a)

VALUE wants as its first argument a variable which holds the name of a second variable. In this case, A holds "vname" and "Value(a)" delivers what's stored in "vname".

VALUE takes a second arg, too:
$z = Value(a,47)
after which, "z" will have whatever was stored where "a" was pointing, and a=47.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
You could also use interpret.

a = "VNAME"
interpret "say a"

Basically you are building a command for REXX to interpret. I usually use this with stem variables personally.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top