Array Filtering

Dick Kriesel dick.kriesel at mail.com
Sat Jun 16 12:21:09 EDT 2012


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 oliver at 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


More information about the use-livecode mailing list