On Jun 16, 2012, at 8:34 AM, Peter Haworth wrote:

> Wondering why rarray is passed by reference?


In the spirit of passing by reference, the answer is:
Refer to the dictionary under "@" for a user contributed note from 
oli...@runrev.com.

In the spirit of passing by value, the answer is:
Passing a parameter by reference means that the data contained in the variable 
is not duplicated as is the case with normal parameter passing. This is useful 
in some cases for improving efficiency. Any situation where you are repeatedly 
passing a large variable to a handler could potentially be speed up by making 
it a reference parameter. Its important to keep track of which parameters are 
passed by reference to prevent unexpected behavior. I tend to use a prefix of 
"r" for reference parameters which a handler mutates ("return parameters", e.g. 
command getTimeAndDate @rTime, @rDate). 

-- Dick
_______________________________________________
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