View previous topic :: View next topic
|
Author |
Message |
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
Hi guys,
I am working on a REXX program in which I have to use an edit macro.
I can pass regular variable between my REXX and my Edit Macro, but I cannot pass stem variables like VAR.I.
so far I tried
Code: |
"ISPEXEC VGET "VAR.I"" |
and
Code: |
"ISPEXEC VGET "VAR."" |
and
Code: |
"ISPEXEC VGET "VAR"" |
but non is correct.
Any ideas?
Thanks in advance,
Mahsa Rouzkhatouni |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
just curious ,
how did you do the VPUT |
|
Back to top |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
Quote: |
how did you do the VPUT |
In my REXX I specify the variables like this:
Code: |
"ISPEXEC VPUT VAR1" |
and then in the macro I pull it this way:
Code: |
"ISPEXEC VGET "Var1"" |
but this works for regular variables, I can't figure out how to pass stem variables.
[/quote] |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
You can't.
There are various methods:
Install program REXXGBLV from Use [URL] BBCode for External Links file 669 or harders-jensen.com, the program allows you to store and retrieve any kind of REXX variables.
Install program STEMPUSH from Use [URL] BBCode for External Links file 411, the program allows you to store and retrieve REXX stems.
Copy all stem.n variable to stemn and VPUT them, i.e copy CAR.22 to CAR22. There are of course limitations to this method and it requires some coding.
Make one big string with the stem variables interspersed by a delimiter, then VPUT the string var. Again this requires some coding and a ISPF variable is limited to 32K size.
Make one big string with the stem variables interspersed by a delimiter, then use the string as the parameter to the macro. |
|
Back to top |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
Quote: |
There are various methods: |
Yeah thanks,
Now that I know there is no standard statement for that, I managed to make a loop in my REXX and assign the stem variable to a regular variable then use it in the macro.
It works fine |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
Glad that you found a solution. Here is a demo of using one string var:
Code: |
/* make demo stem */
car.1='Opel'
car.2='Ford'
car.3='Mazda'
car.4='Peugeot'
car.5='Tesla'
car.0=5
/* pack */
cars=''
do n=1 to car.0
cars=cars || car.n || '\'
end
drop car.
/* unpack */
do n=1 to 9999 while cars<>''
parse var cars car.n '\' cars
end
car.0=n-1 |
|
|
Back to top |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
Quote: |
Here is a demo of using one string var: |
Nice, thanks |
|
Back to top |
|
|
|