For loop with multiple controll variables
Posted: Wed Sep 10, 2014 9:04 am
Hello,
First of all, I am using EViews 7.2. :D
I have got a question concerning to "For Loops": I know how those loops work and how they can be nested, but I seek for a possibility do write a for-loop which performs a simultaneous update of two or more control variables each iteration. This would mean that with each "next" command both variables update. I give an example:
The problem is, that if I nest both loops like
The result is completely different as you all know: The inner loop performs its tasks for each value of the outer loop. But what I actually whish to do in this simple example is to "rename" forecast0 into forecast1 and forecast4 into forecast2 etc. I want to emphasize that my question is not about how to rename a series, but to find a way that two control variables within a loop update simultaneously.
I would appreciate help very much!
Greetings from Heidelberg, Germany!
First of all, I am using EViews 7.2. :D
I have got a question concerning to "For Loops": I know how those loops work and how they can be nested, but I seek for a possibility do write a for-loop which performs a simultaneous update of two or more control variables each iteration. This would mean that with each "next" command both variables update. I give an example:
Code: Select all
for !time=0 to 32 step 4 !AND? !i=1 to 9 step 1
series forecast!i = forecast!time
next
Code: Select all
for !time=0 to 32 step 4
for !i=1 to 9 step 1
series forecast!i = forecast!time
next
next
I would appreciate help very much!
Greetings from Heidelberg, Germany!