On Nov 22, 2014, at 10:38 PM, Dr. Hawkins wrote:

> Pass by reference *should* be something useful, but it seems half done.
> 
> I have various handlers with optional parameters.
> 
> It seems that if *any* parameter is passed by reference, omitting any
> variable causes a runtime error

Hmm. I tested this:

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

…and got an error message. But if I make the second parameter in the 
setVariable function *not* by reference

on setVariable @incomingVar,someOtherVariable

then the same test works. It appears that if you are passing variables by 
reference you must supply all the referenced variables, but you can leave out 
non-referenced variables.

I'm using an older version of LC: 2008 MacBook, OSX 10.7.4 (Lion), Rev Studio 
5.5.1, build 1487. Don't know about lC 6.x or 7.x.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to