Am 20.12.2023 um 09:41 schrieb Artur T.:
Hi all,
Let's say we have a string array 'input'. The first example shows that
the for-loop can be used for printing each element of the array.
However, as the 2nd example shows, if the string array is stored in
bundle B this does not seem to work currently.
I could not find anything in the User's Guide about this restriction.
Is it expected that one cannot print the elements of B.input as can be
done for input itself?
Yes, I think that's expected, given the history and
legacy of the
foreach mechanism in gretl. Of course, one could still wish that it
should work...
# prints only 'B.input'
loop foreach i B.input
print "$i"
endloop
What's funny is that if you use B["input"], then you get a very
detailed
error message about an array not being acceptable; which is clearly
misleading these days, because a string array in principle is now supported.
cheers
sven