Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Wed Feb 20, 2019 6:37 am Post subject: VPUT an "indirect" variable
I've got a workareound if need be, but I was wondering if what I want to do here is achievable.
What I want to do is run a panel that saves the content of a field on the panel in one variable and the actual contents of that NAMED variable in another. Here's my code
Code:
VPUT (MASK) PROFILE
*REXX(*)
say 'In MASK PROC' ; trace i
temp = 'FILE=FRED.BERT.JOHN,FNR=123§'
interpret MASK"='"temp"'"
say 'ABC123='abc123
interpret "LIST='"MASK"'"
say 'LIST='list
/* say 'MASKCO='maskco */
*ENDREXX
VPUT (&LIST) PROFILE
What I am trying to do here is to VPUT two variables, 1 that contains the contents of MASK (ABC123 in this example) and one where the NAME of the VPUT'ed variable would be ABC123 and its contents would be 'FILE=FRED.BERT.JOHN,FNR=123§'
When I test the panel via 7;2, I end up with an error
Quote:
Current dialog statement:
VPUT () PROFILE
Is there a way to get round this easily ? _________________ Michael
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Sat Feb 23, 2019 3:39 am Post subject:
Thanks Nic for the suggestion.
I ended up not bothering with my solution. Instead, I designed it as I usually do, which means putting all the logic in the Rexx script that drives the panel.
To my way of thinking, it seems much easier. I don't need to worry about IF statements being correctly indented. I don't have to bother defining ALL my messages in a message library, as well as seeing (and wondering) what message DI123A actually contains.
For example, if I press a specific pfkey, then a filename should be checked for being non blank and valid. If I press a different one, then a blank filename is valid.
Easy in Rexx, not so much so in the )PROC section of a panel. _________________ Michael
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum