MathGroup Archive 2006

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

Search the Archive

Re: Variables Within Homemade Functions


See Help browser for info on Module and Block.


Bob Hanlon

---- Gregory Lypny <gregory.lypny at videotron.ca> wrote: 
> 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: RE: Variables Within Homemade Functions
  • Next by Date: function's local constants interdependence
  • Previous by thread: RE: Variables Within Homemade Functions
  • Next by thread: RE: Variables Within Homemade Functions