Dear all
I spent some time before i realized the position of a declaration of
array as argument of a function seems to be very critical.
I mean that this following script is NOT working "as is", but if i
change the position of the declaration it works.
-----------------------------------------------------
#ARRAY DECLARATION far from yahoo_get
strings P = defarray("A2A.MI", "ANIM.MI")
# OPEN SET 10 DAYS
nulldata 10
# TIME SERIES
setobs 5 2016-07-01 --time-series
# CALL yahoo_get
include yahoo_get.gfn
######## QUESTION ITEM
######## strings P = defarray("A2A.MI", "ANIM.MI")
#DOWNLOAD LOOP
loop i=1..nelem(P)
A=yahoo_full(P[i])
endloop
------------------------------------------------------------
you easily can verify the script isn't working
BUT
if I put the array declaration near the yahoo_get the script works.
-----------------------------------------------------
######## cut off
the previous declaration
######## strings P = defarray("A2A.MI",
"ANIM.MI")
# OPEN SET 10 DAYS
nulldata 10
# TIME SERIES
setobs 5 2016-07-01 --time-series
# CALL yahoo_get
include yahoo_get.gfn
#ARRAY DECLARATION near yahoo_get
strings P = defarray("A2A.MI", "ANIM.MI")
loop i=1..nelem(P)
A=yahoo_full(P[i])
endloop
------------------------------------------------------------
now it works.
So maybe it's a trivial subjetc but i will appreciate some help to understand why it
happens.
Cheers
Guido