On Thu, 23 Feb 2017, Sven Schreiber wrote:
Am 23.02.2017 um 15:50 schrieb Schaff, Frederik:
> Many thanks to both of you! The second, more general is working fine.
> Although it would be a nice feature if one could directly access the
> name of a variable (something like idname).
For a list L, "(varnames(L))[i]" should get you a string with the name of the
i-th variable in the list.
(Allin, if you read this: "varnames(L)[i]" produces an error, the extra
parenthesis is necessary, don't know whether that's a bug, although I
certainly understand why gretl is choking.)
Two points here. For a list L,
* "varnames(L)[i]" now works OK in git; and
* The alternative "varname(L[i])" now also works.
The first fix was just a matter of trivially generalizing something.
The second was kinda subtle: varname() required the ID number of
a series, while what you get from "L[i]" is an actual series, not its
ID number. Now varname() accepts either an ID number or a series
itself.
Allin