how are variables passed from functions?

J. Landman Gay jacque at hyperactivesw.com
Fri Nov 14 13:28:26 EST 2014


On 11/14/2014, 9:12 AM, dunbarx at aol.com wrote:
> I don't see any anomaly here. Since the intermediate function calls yet another function, it never needs to "close", that is, return, a value. It is a pass-through entity, a card carrying member of the chain of handler calls. Step through this variation:
>
>
>
> on mouseUp
>      put double(2) into myVar1
> answer myVar1
> end mouseUp
>
>
> function double var
>     put redouble(var * 2) into myVar2 -- no return in this function
> end double
>
>
> function redouble var
>     return var * 2
> end redouble
>
>
> The "8" you get is processed sequentially through the handler path, just like bacon.

Boy, I don't know. It seems wrong to me. The scope of a variable is 
supposed to be handler-specific unless declared otherwise, and "myVar2" 
should not be available outside of double().

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list