Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

RE: Variables Within Homemade Functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69595] RE: [mg69590] Variables Within Homemade Functions
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 17 Sep 2006 06:57:06 -0400 (EDT)

Greg,

What is a Module for?

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 

From: Gregory Lypny [mailto:gregory.lypny at videotron.ca]
To: mathgroup at smc.vnet.net


Hello everyone,

How can I ensure that variables in my home made function do not  
conflict with variables with the same name outside the function?  Say  
I have a variable, t, whose value in my notebook is 17.  I've brought  
in a function from another notebook, myFunction, that contains a  
variable named t, and in running the function, t will take on a  
value.  Unfortunately, both t's are the same.  Is there any way to  
make the t within the my function a local variable just like index  
counters in the Table and Do functions?

Regards,

	Greg

t=17

myFunction[x_]:=(t=someOtherValue; rest of function here)



  • Prev by Date: function's local constants interdependence
  • Next by Date: Re: Why is the negative root?
  • Previous by thread: Re: Variables Within Homemade Functions
  • Next by thread: Re: Variables Within Homemade Functions