On Dec 17, 2017, at 5:24 PM, Allin Cottrell <cottrell(a)wfu.edu>
wrote:
> This worked fine for me when I wrote it. However currently with the latest Windows
snapshot, after the first time through the loop, gretl stores successive data sets under
the name "(a)fname.gdt". The string is being updated properly, but not parsed by
the store command. If I insert the line
>
> blah = "@fname"
>
> between the sprintf and store commands, everything works fine.
I tried constructing the following test case (on the assumption that the undefined
identifier "nbreaks" was supposed to be the same as the defined
"Nbreaks":
Yes, that was my email "correcting" hansl
If you use the function-form of sprintf; that is
fname = sprintf("rho_%d.gdt", Nbreaks)
in place of
sprintf fname "rho_%d.gdt", Nbreaks
It works OK; otherwise I see the error that you describe.
So, yes, this is a bug (associated with an old usage of "sprintf", but a usage
that supposedly still ought to work). I'll see what can be done, but also I guess we
should officially deprecate the command-form of "sprintf" -- if we don't
already do so.
My original code was actually (iirc) my first successful use of sprintf for this sort of
thing! I'd forgotten about its functional form, although I also recall you helping me
out with that too.
Thanks, Allin!
PS