[Gretl-devel] bundle member in loop boundaries

Allin Cottrell cottrell at wfu.edu
Tue Jul 12 15:45:30 EDT 2016


On Tue, 12 Jul 2016, Sven Schreiber wrote:

> Hi,
> the following doesn't work:
>
> <hansl>
> bundle bc
> bc.from = 2
> loop i=bc.from..3
>  print i
> endloop
> </hansl>
>
> I'm not sure it's supposed to work, but at least it seems to contradict this 
> explanation from the manual (section 12.2):
>
> "The starting and ending values for the index can be given in numerical form, 
> by reference to predefined scalar variables, or as expressions that evaluate 
> to scalars."
>
> Or isn't 'bc.from' an "expression" in this sense?

Yes, in principle it ought to be OK. But it's confusing the loop 
parser because the dot in "bc.from" is getting mixed up with the 
dots in the "from..to" formulation. The alternative,

loop i=bc["from"]..3

works alright. I'll see about fixing this.

Allin


More information about the Gretl-devel mailing list