Replace the for loop line with

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Replace the for loop line with

Postby miorinnovo » Tue Mar 20, 2018 1:00 pm

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

EViews Matt
EViews Developer
Posts: 557
Joined: Thu Apr 25, 2013 7:48 pm

Re: Replace the for loop line with

Postby EViews Matt » Tue Mar 20, 2018 1:11 pm

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 18 guests