Loop over pre-defined string
Posted: Wed Oct 16, 2013 4:35 am
Hi,
I have a pre-defined string containing variables:
%components = "pieh schp banp ncar main"
I want to loop over these variables, like I do here:
for %n {%components}
series dc_{%n}
call devcycle (dc_{%n}, {%n}, 0)
delete {%n}
next
This combination of variables is used multiple times in my program and I do not want to change it everywhere, but only once (at the start of my program), so it is also easy to use for others. Unfortunately this does not work, since it does not take the five components as seperate variables, but defines %n = "pieh schp banp ncar main".
Can/should this be done in a different way?
Thanks,
Paul
I have a pre-defined string containing variables:
%components = "pieh schp banp ncar main"
I want to loop over these variables, like I do here:
for %n {%components}
series dc_{%n}
call devcycle (dc_{%n}, {%n}, 0)
delete {%n}
next
This combination of variables is used multiple times in my program and I do not want to change it everywhere, but only once (at the start of my program), so it is also easy to use for others. Unfortunately this does not work, since it does not take the five components as seperate variables, but defines %n = "pieh schp banp ncar main".
Can/should this be done in a different way?
Thanks,
Paul