If statement question

For questions regarding programming in the EViews programming language.

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

Akavall
Posts: 14
Joined: Tue Mar 09, 2010 10:01 am

If statement question

Postby Akavall » Thu Mar 18, 2010 5:25 pm

Hello,

I tried to run this code

Code: Select all

if 10 < index(!i,1) <= 20 then zz(!i,1) = X(!i,1) else zz(!i,1) = na endif
I am trying to tell EViews that index(!i,1) should be between 10 and 20, but it seems to treat my command as just "10 < index(!i,1". What would be the proper way to write this code?

Thank You in advance.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: If statement question

Postby startz » Thu Mar 18, 2010 7:00 pm

Try something like

Code: Select all

if 10 < index(!i,1) and index(!i,1) <= 20 then

Akavall
Posts: 14
Joined: Tue Mar 09, 2010 10:01 am

Re: If statement question

Postby Akavall » Thu Mar 18, 2010 8:01 pm

Yes. This works. Thank You Very Much!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests