any use of pass by reference breaks any omitted variable?

Bob Sneidar bobsneidar at iotecdigital.com
Tue Nov 25 10:29:08 EST 2014


I went the other direction. 

on testReference
  put 8 into someVariable
  put 5 into someOtherVariable
  setVariable , someVariable -- second param omitted
  answer "someVariable was 8, and is is now:" && someVariable
end testReference

on setVariable incomingVar, @someOtherVariable 
  add 1 to incomingVar
end setVariable

Works fine. Seems logical that if passing by reference it would require a value for such variables, as it would otherwise result in referencing a variable that to the handler does not exist. 

Bob S


> On Nov 24, 2014, at 11:05 , Peter M. Brigham <pmbrig at gmail.com> wrote:
> 
> on testReference
>   put 8 into someVariable
>   put 5 into someOtherVariable
>   setVariable someVariable -- second param omitted
>   answer "someVariable was 8, and is is now:" && someVariable
> end testReference
> 
> on setVariable @incomingVar, at someOtherVariable 
>   add 1 to incomingVar
> end setVariable





More information about the use-livecode mailing list