[futurebasic] Re: [FB] Function calls with Globals as parameters

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2009 : Group Archive : Group : All Groups

From: Jay Reeve <jayreeve@...>
Date: Thu, 15 Oct 2009 08:29:20 -0500
Bill,

I can't see a problem with either approach, other than the fact that  
your examples are not all declared as returning double  values.  
Obviously the simpler should be faster. You should even be able to do  
something like this, omitting one variable transfer:

local fn example#
'...
end fn = fn process#(gtestparameter#)

   e-e
   =J= a  y
    "


On Oct 15, 2009, at 8:05 AM, Bill Zielenbach wrote:

>
> Suppose there is a function that does some standard operation on a  
> variable
>
> local fn process#(a#)
> dim b#
> // do something with a# to get b#
> end fn=b#
>
> Sometimes I use it to process a parameter defined locally
>
> local fn example1
> dim c#,d#
> c#=1
> d#=fn process#(c#)
> end fn=d#
>
>
> Other times I'd like to use it to process a parameter defined globally
>
> Begin Globals
> dim gtestparameter#
> gtestparameter#=1
> end globals
>
> local fn example2
> dim e#
> e#=fn process#(gtestparameter#)
> end fn=e#
>
> I have a vague recollection of having once been burnt by fn  
> example2 so I
> have been using
>
> local fn example3
> dim c#,d#
> c#=gtestparameter#
> d#=fn process#(c#)
> end fn=d#
>
>
> Is there any problem with the fn example2 approach for non-array  
> global
> variables?
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>
>