Am 04.12.19 um 00:22 schrieb Riccardo (Jack) Lucchetti:
On Tue, 3 Dec 2019, Artur Tarassow wrote:

<hansl>

strings S = defarray("A", "B", "C")
loop foreach i S -q
    eval S[i]
endloop

matrix M = seq(1,3)
loop foreach i M -q
    eval M[i]
endloop

</hansl>

Ah, that was my mistake. Sorry for the noise. I don't know why I just did not make use of the $-accessor, but tried to do some selection. The following works exactly as (I) expected it :-)

<hansl>
strings S = defarray("A", "B", "C")
loop foreach i S -q
    eval $i
endloop

matrix M = seq(1,3)
loop foreach i M -q
    eval $i
endloop

matrix M = mnormal(3,4)
loop foreach i M -q
    eval $i
endloop
</hansl>


@Jack: I just wanted to save time by coding less, as <loop foreach i S> is a bit shorter than <loop i=1..nelem(S)> :-)

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/

Reply via email to