How do I skip lines of code?

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

How do I skip lines of code?

Postby miorinnovo » Mon Jan 28, 2019 2:50 pm

I'd like to skip a couple lines of code but can't seem to find a way to program it. SImply put I have 3 variables for 2 different cities and only 2 variables for a third city. I would like to skip the data manipulation code for that third variable when I get to the third city. I am using a for loop:

for %city city1 city2 city3

and thought an if statement would work but not sure how.

thanks in advance for any help

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: How do I skip lines of code?

Postby EViews Gareth » Mon Jan 28, 2019 5:52 pm

Code: Select all

for %city city1 city2 city3
if %city<>city3 then
'do manipulation stuff here
endif
Follow us on Twitter @IHSEViews

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

Re: How do I skip lines of code?

Postby miorinnovo » Tue Jan 29, 2019 7:23 am

Thanks, this gives me an error:

city3 is not defined in "if %city<>city3 then"


edit: it worked once I put city3 in quotes

if %city<>"city3" then

Thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 70 guests