Am 21.12.23 um 16:54 schrieb Cottrell, Allin:
On Wed, Dec 20, 2023 at 3:41 AM Artur T. <ate...@posteo.de> wrote:
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?
<hansl>
input = defarray("R1", "R2", "R3")
bundle B = _(input)
# Prints each element
loop foreach i input
print "$i"
endloop
# prints only 'B.input'
loop foreach i B.input
print "$i"
endloop
</hansl>
Up till now, the assumption has been that an array or bundle featuring
in a "loop foreach" command must be a top-level object, not embedded
inside something else. In current git, however, that limitation is
relaxed. The following script illustrates what is now working.
Happy New Year to all list-members!
Thank you for the implementation, Allin. It works nicely now!
Artur
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/