Creating loops with different variables

For questions regarding programming in the EViews programming language.

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

mjamei
Posts: 5
Joined: Fri Jan 27, 2012 4:04 am

Creating loops with different variables

Postby mjamei » Fri Jan 27, 2012 4:24 am

Hi,

I'm trying to create a program that works out a simple quarter on quarter change on a number of variables however I can't get the loop function to work fo some reason.

Here's the code:
for %v NEVI NEVJ NEVK NEVL
smpl 1990:01 2010:04
delete p%v
genr p%v = 100*(%v/%v(-1))-1)
next

I've only included a couple of variables here to demonstrate but it keeps coming back with an error message so I'm assuming I've made a mistake in the coding (or more than one mistake! :/)

Thanks in advance

reep
Posts: 14
Joined: Fri Jan 27, 2012 2:24 am

Re: Creating loops with different variables

Postby reep » Fri Jan 27, 2012 6:04 am

You have to use {} around %v.
for example: p{%v}

mjamei
Posts: 5
Joined: Fri Jan 27, 2012 4:04 am

Re: Creating loops with different variables

Postby mjamei » Thu Feb 02, 2012 10:11 am

Brilliant, works fine.

Thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests