On Sun, 10 May 2020, Sven Schreiber wrote:
Hi,
I'm encountering two (and a half) problems with setting the descriptive
label of a series via 'setinfo'. This happens when I use this command
inside a function package which returns the resulting series.
1 - This first problem I cannot reproduce with a minimal function
example; I'm suspecting it might depend on being wrapped inside a
package. The problem is that the descriptive label of a series is _not_
overwritten with a new content when the series itself is replaced by the
return value of the package.
1b - Another thing that somehow seems to depend on doing it inside a
package: Doing 'setinfo myseries --description="@mylabel"' for an
existing string variable 'mylabel' just yields the literal "mylabel"
as
description.
I'd have to see examples to say anything useful in those cases.
2 - The --description option to 'setinfo' apparently does
not allow a
string variable as input. Doing --description=s for an existing string s
just gives the literal "s" as the label.
In general you cannot expect a string variable to be cashed out in
the context of a gretl command option parameter. However, there is a
"hidden" mechanism available which should probably be tested more,
perhaps modified, and documented: you use eval() in this content. So
for example this should work:
string s = "whatever"
setinfo some_series --description=eval(s)
Allin