cottrell(a)wfu.edu @ INTERNET skrev 2007-11-06 22:03:15 :
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.
As I understand it, this is a new parameter type for functions, in addition
to the already existing six parameter types bool, int, scalar, series,
list, matrix? I cannot find anything about this in the User's Guide. Also,
the function floor() is not documented in the command reference. Could it
be added, please?
Andreas