On Fri, 20 Mar 2020 22:24:11 -0500, Steve Horein wrote: >Here's a rexx example of a variable containing the names of other variables >that hold values: > >/* This is the main REXX program */ >j=1;k=6;m=9 >a ='j k m' >call test >exit > >/* This is a subroutine */ >test: procedure expose (a) /* Exposes A, J, K, and M */ > say a j k m /* Displays "j k m 1 6 9" */ > return > Then with PARSE VAR A V1 V2 V3 and using VALUE() you can have variable variables.
It's a pity that: o No similar construct is available for sharing variables with external procedures. o Symbols EXPOSEd from external scopes can't be used as targets of ITERATE and LEAVE. (I eschew GOTO; SIGNAL is worse,) o There's no complement of EXPOSE for the programmer who wants to protect a few symbols and leave all others accessible by default. ooRexx, perhaps? > https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.4.0/com.ibm.zos.v2r4.ikja300/proced.htm -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
