On Tue, 6 Nov 2007, Ignacio Diaz-Emparanza wrote:
El Tuesday 06 November 2007 04:17:47 Allin Cottrell escribió:
> > 4) enable GRETL_TYPE_STRING as a function argument and store a
> > copy of the string in the global array, only marked at a
> > different level. The copy should be destroyed on function exit.
>
> Yes, IMO this is the only sane way to go. I've made a start on
> it. The modifications to the existing code are not too severe.
> I'll test tomorrow than make a snapshot available.
Thank you. I will test it with my scripts when this be available.
In CVS and Windows snapshot you can do the following (revised
version of Ignacio's sample script):
<script>
function sillyfun (string foo, series x)
series @foo_f1 = x+x(-1)+x(-2)+x(-3)
series @foo_f2 = x+x(+1)
list outlist = @foo_f1 @foo_f2
return list outlist
end function
open data9-9
string sname="nocars"
list alist = sillyfun(sname, nocars)
print alist
</script>
Alternatively, you could give the string argument to sillyfun as a
quoted string literal:
list alist = sillyfun("nocars", nocars)
This should also work in the GUI function-caller. In that case
you type something into the string parameter slot: if it's the
name of an existing string, it gets used as is; if it's not the
name of a pre-defined string it is treated as literal, and is
automatically wrapped in quotes if it's not already quoted.
Allin, do you remember my problem with the decimal commas?
Yes, I remember puzzling over that for quite some time.
I have just updated my Kubuntu to version 7.10 and ... the
problem disappeared!
That's good to hear!
Allin.