Page 1 of 1

exception to a FOR loop

Posted: Wed Jul 15, 2009 4:17 pm
by Ingolstadt
hi,

any ideas how i could include an exception for a loop, because atm i have to rewrite the code for every single case. short example:

for !j = to 4
for !i = 1 to 30
eq.ls(n) pd!k c pdl(series4, 4, 2) pdl(series!i, !j, 2)
next
next

in this example, my loop gets an error ofc, because i can't include the same variable a second time. what i need would be something like:

for !i = 1 to 30 'except' 4

it would rly help a lot, thx in advance.

Re: exception to a FOR loop

Posted: Wed Jul 15, 2009 4:35 pm
by EViews Gareth
just use an if statement

Code: Select all

for !j = to 4 for !i = 1 to 30 if !i <> !j then eq.ls(n) pd!k c pdl(series4, 4, 2) pdl(series!i, !j, 2) endif next next

Re: exception to a FOR loop

Posted: Thu Jul 16, 2009 1:30 am
by Ingolstadt
again the simplest way is the best :D thx