Passing an array to a function/handler
dsc at swcp.com
Wed Jun 11 20:06:00 EDT 2003
On Wednesday, June 11, 2003, at 05:27 PM, Huisingh, Larry R wrote:
> I can't tell from the docs...Can you pass an array to a function (or
Yes, but arrays do not have full value semantics.
You can pass an array as a parameter.
You can return an array as the "value" of a function, but that cannot
be directly a parameter to another function or handler and it cannot be
[ ]'d. You cannot create array expressions.
This means you can use an array to represent interesting data, but the
fact that it is an array cannot be hidden. (Because of that, you can
feel free to use reference variables as parameters, should you work
with very large arrays, even when you don't modify the variable--you
can't have an array expression as a parameter, anyway.)
function fetch e, k
put "abc" into x["a"]
put "a" into x["b"]
put "eee" into y["v"]
put fetch(y,"v") & LF into field "Report"
put fetch(makeA(),"a") & LF after field "Report"
put makeA() into y
put fetch(y,"b") & LF after field "Report"
This produces this:
It does not produce this:
Also, arrays will be empty whenever a string conversion occurs. This
Revolution Lurker who needs arrays. Or, at least, a bonus.
More information about the metacard