I am having problems calling a subroutine in a loop.
The code looks like this:
Code: Select all
for !i=1 to 2
%n = @str(!i)
equation ar_{%n}.ls {%dep} ar(!i)
ar_{%n}.makeresids ar_{%n}_res
%res= "ar_{%n}_res"
call autocorrelations
next
The subroutine creates a vector with the autocorrelation up to a prespecified lag. When I run the program I only get results for the AR(1). It seems like the command "call" stops the loop. If I remove the subroutine, everything is fine, but I obviously don´t get the vector with the autocorrelations.
Does the call command stop the loop or is there another problem ?