Subscribe Bookmark RSS Feed

List of variables not reporting the way I want

I'm trying to create a return statement for a function that contains multiple local variables.

a= 1;
b = {1,2,3};
c= {"a","b","c"};
return = {a,b,c};

I want to have return == {1,{1,2,3},{"a","b","c"}}
but instead i get return == {a,b,c};

since a,b,c are local variables in a funtion return has no meaning when its sent out of the function.

Any Ideas?
Nevermind. Found the answer myself about 5 min later.

For anyone who is having the same problem
eval list(return) works.

Super User


Jun 23, 2011

This example seems to work as you want:

myListFunc = Function( {x1, x2, x3}, Eval List( {x1, x2, x3} ) );
myListVal = myListFunc( 1, {1, 2, 3}, {"a", "b", "c"} );
Show( myListVal );

And I see you figured it out too...

Message was edited by: mpb