On Wed, 25 Sep 2013, Allin Cottrell wrote:
On Wed, 25 Sep 2013, Sven Schreiber wrote:
> 2) But this also doesn't work (with suitably defined variables):
>
> dummy = sscanf( strsub(isodate(newepochdate),"-",""),
"%d", newdate )
>
> while the non-nested variant does work:
>
> <hansl>
> tempstr = strsub(isodate(newepochdate),"-","")
> dummy = sscanf( tempstr, "%d", newdate )
> </hansl>
>
> Here I don't see why there should be a difference -- it rather looks as
> if the earlier bug with string-producing functions hasn't been fully
> squashed.
The first one ought to work, agreeed, but the problem here is different from
the earlier bug. The issue is that the sscanf() function uses the same
mechanism as the (old, deprecated) "sscanf" command, which gets passed the
whole line as a single argument. I guess it's time to get rid of the command
version and redo sscanf() as a proper function.
Done in CVS. The nested thing will now work. The command-form of sscanf
has been deprecated since gretl 1.9.4, so I think it's not too abrupt to
trash it now.
Allin