On Thu, 8 Aug 2013, Logan Kelly wrote:
Hello,
I need to delete a series inside a loop. Is there a way to do this? What I am doing is
loading data on a country, process the data, save some results, replace the data with the
next country's in my data set. Below is my code that does not work:
loop i = 1..numcountry
cc = strsplit(ccode,i)
append "(a)datafile.xlsx" --time-series --sheet="@cc" --coloffset=0
--rowoffset=1
#Do some stuff
delete Q* # yields an error
delete R* # would yield an error if previous line did not
end loop
This of course yields the error:
You cannot delete series in this context
I understand that delete does not work in a loop, but is there a work around? Or a better
way to handle repeated processes?
Why not just wrap everything into a function and then call the funciton
from within the loop? That will take care of thrashing local variables
automatically.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------