Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: something nice I found today, return multiple values from a function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113095] Re: something nice I found today, return multiple values from a function
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Tue, 12 Oct 2010 13:51:56 -0400 (EDT)
  • Reply-to: nma at 12000.org

On 10/12/2010 3:52 AM, Nasser M. Abbasi wrote:

>
> --------------------
> getPointCoordinates[] := Module[{x,y}, {x ->  10, y ->  7}]
>
> p = getPointCoordinates[];
> x = x /. data;
> y = y /. data;
>
> Print["x=", x]
> Print["y=", y]
>
> x=10
> y=7
> ---------------------
>

Opps, I was in middle of editing and pasted earlier version, here is the 
final version:

------------------
getPointCoordinates[x_, y_] := Module[{}, {x -> 10, y -> 7}]

p = getPointCoordinates[x, y];
x = x /. p;
y = y /. p;

Print["x=", x]
Print["y=", y]

x=10
y=7

--------------------

--Nasser


  • Prev by Date: Re: Graphics3D. How to join random points with a single
  • Next by Date: Re: Generation of polynomials
  • Previous by thread: Re: Graphics3D. How to join random points with a single
  • Next by thread: Re: something nice I found today, return multiple values from a function