I guess I found a bug in the stringify() function. In the following
example both "x" and "z" are constant integer series taking, for
instance, value 1. In case the length of the string array "S" equals
nobs(series), the mapping is _not_ right. However, in case nelem(S) >
nobs(series) things work ok.
set verbose off
series y = seq(1,3)'
series x = 1
series z = 1
strings S1 = defarray("A", "B", "C")
strings S2 = defarray("A", "B", "C", "D")
scalar err1 = stringify(y, S1)
scalar err2 = stringify(x, S1)
scalar err3 = stringify(z, S2)
print err1 err2 err3
The last print command yields:
index y x z
1 1 A A A
2 2 B B A
3 3 C C A
Obviously, the mapping is not right for x but for z.
This is with 2-days old gretl (git) on Ubuntu 20.04.