Page 1 of 1

Loop inside loop

Posted: Mon Jan 06, 2014 1:45 pm
by rmoralesaramburu
Hello,

I can't fill my matrix with this program, it just fills 1 data value in all the rows.

Code: Select all

matrix(18,3) tabledata for %y br co cz hu id ma mx pd pe ph ru sa si sk ta th us vn for !i=0 to 17 tabledata(!i+1,1) = @last(pend_long_{%y}) next next
What I am doing wrong?

Re: Loop inside loop

Posted: Mon Jan 06, 2014 2:16 pm
by EViews Gareth
The right hand side of the equality does not depend upon !i

Re: Loop inside loop

Posted: Mon Jan 06, 2014 2:24 pm
by rmoralesaramburu
Can you help me with the correct syntax?

Re: Loop inside loop

Posted: Mon Jan 06, 2014 2:28 pm
by EViews Gareth
Not without knowing what you are trying to do.

Re: Loop inside loop

Posted: Mon Jan 06, 2014 2:46 pm
by rmoralesaramburu
Thanks I already figure it out. This was the correct coding

Code: Select all

matrix(18,3) tabledata !i=-1 for %y br co cz hu id ma mx pd pe ph ru sa si sk ta th us vn !i=!i+1 tabledata(!i+1,1) = @last(pend_long_{%y}) next