Page 1 of 1

for loop with skipped values

Posted: Thu Oct 21, 2021 10:26 am
by remuct
Hello,
I am wandering if there is a possibility of executing a for loop by skipping some values.
For example, I have 100 variables v1, v2,...v100 and I want to set them all to zero except v52 and v80. Is there a way of doing this within a "restricted" for loop?
Thank you

Re: for loop with skipped values

Posted: Thu Oct 21, 2021 12:17 pm
by EViews Gareth
Put an if statement inside the loop

Re: for loop with skipped values

Posted: Thu Oct 21, 2021 2:53 pm
by remuct
This was so simple I didn't think doing this way. Thank you!