associative arrays
Mr X
monsieurx at crosscomm.lu
Fri Dec 13 14:52:00 EST 2002
There's also the obscure but "documented" feature of parameter by reference
a sort of pointer...
go to the index menu in the toolbar,
pull the index
type para
click on
"parameters, call by reference"
hope it helps, Scott just pointed me its existence!
> -----Original Message-----
> From: metacard-admin at lists.runrev.com
> [mailto:metacard-admin at lists.runrev.com]On Behalf Of Robert Brenstein
> Sent: Friday, December 13, 2002 7:31 PM
> To: metacard at lists.runrev.com
> Subject: Re: associative arrays
>
>
> >On Friday, December 13, 2002, at 02:47 AM, Robert Brenstein wrote:
> >
> >>However, I need to pass it as an argument to a function that is
> >>dynamically defined and executed through do.
> >>
> >>put webArg into fName -- let's say webArg = somfunction
> >>
> >>do "get" && fName & "(" & myArray & ")"
> >>
> >>function somfunction myArray
> >>return myArray[key]
> >>end somfunction
> >>
> >>In somfunction, the associative array give empty values for key and
> >>array elements.
> >
> >I have seen other limitations. I can return an array from a
> >function and pass an array as a parameter but not both in the same
> >expression as in somFunction(buildArray()).
> >
> >I have been successful in this:
> >do "someHandler a b c"
> >where c is a handler local variable containing an array.
> >
> >You may want to experiment with value().
> >
> >I hope you mention how you solve this.
> >
> >Dar Scott
> >(a Revolution user sitting in the back row)
>
> I found a workabout not the solution. Only Scott can tell us whether
> failure to pass associative array is a bug or a feature. Sounds like
> a bug to me (do parser not passing the correct thing).
>
> My program is a CGI and I split incoming web arguments in a front
> script that does pre-handling. A nice and clean solution would be to
> simply pass the array further to the function that actual processing.
> The workabout is that I pass raw web arguments and redo the split in
> each function. Waste of some cpu cycle but mostly the elegance -- the
> handler functions are provided my different people and I wanted to
> hide the direct handling of arguments. Oh, well.
>
> Robert
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
More information about the metacard
mailing list