On Sun, 20 Jun 2021, Sven Schreiber wrote:
Hi,
for the first thing, here's a minimal example:
<hansl>
function void checko(list L)
list L print # d_LRY d_LRM (expected result)
varlist # weird: 0) const 5) [masked] 6) [masked]
end function
open denmark
list L = LRY LRM
checko(diff(L))
</hansl>
"varlist" is not showing series 1 to 4 because they're not supposed
to be visible inside the function; they were not passed in. It's
showing "[masked]" for series 5 and 6 because they were passed as
list members, and inside the function you're supposed to access them
via the list, or individually as <listname>.$i.
OK, then in my use case I'm also using 'append' (inside
the function) to
load data from a csv file. The first part of that csv file contains the
same data as in the list L, with the same series names. However,
afterwards it seems that for example d_LRY appears twice in the dataset
- at least it's the result of an empty "print".
You've added a new series, "d_LRY", local to the function. This
leaves undisturbed the series passed in via list, which could be
accessed inside the function as L.d_LRY. The new "d_LRY" will not
propagate to the caller unless you return it.
If there's a bug here, it's that the "print" (all series) command
shows the name "d_LRY" twice: on the first occurrence it should
probably be shown as "[masked]" or as "L.d_LRY". In fact, if it can
be arranged without too much difficulty, we might replace all
occurrences of "[masked]" with the form "listname.seriesname".
[Guide, section 14.4, subsection "List arguments"]
Allin