Page 1 of 1

Replace the for loop line with

Posted: Tue Mar 20, 2018 1:00 pm
by miorinnovo
Hello,

I have a few of the exact same for loops in a program. I was wondering if there is a way change them all at once. In other words, my for loop goes through a list of variables which I am adding to, rather than going to every line where that for loop appears is it possible to change it once in the program?

Thanks

Re: Replace the for loop line with

Posted: Tue Mar 20, 2018 1:11 pm
by EViews Matt
Hello,

Sure, you can create a string variable (in one place) holding the list of variables and then use it in multiple for loops. For example,

Code: Select all

%variable_list = "a b c d" for %var {%variable_list} ... next for %var {%variable_list} ... next