Array Filtering

Bob Sneidar bobs at twft.com
Mon Jun 18 12:04:41 CDT 2012


Yes, consider a HUGE array. Better to pass by reference. I am going to give Dick's method a try, only with 2 repeat loops to account for the numbered key structure of a Datagrid array. It sure would be nice if the engine had an array conversion feature which converted an array to a sqLite database, and back again don't you think? It would make things like this extremely easy, as all you would have to do is convert, query and convert back. 

Bob


On Jun 16, 2012, at 9:21 AM, Dick Kriesel wrote:

> 
> 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
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list