Making the move...

Chipp Walters chipp at chipp.com
Wed Mar 22 00:01:10 EST 2006


I'm just a simple Caveman programmer. Your advanced technology and talk 
of arrays and multiple functions frighten me. In this case, I'd just as 
soon keep thinkgs in a single handler which cavemen like me can read and 
debug easily.

:-)

-Chipp

Sarah Reichelt wrote:
> I didn't think of that Mark. Again, arrays are things that don't come
> naturally to me, so I probably ignore them when they would be useful.
> In this case, it sounds like a really good solution.
> 
> Thanks,
> Sarah
> 
> 
> On 3/22/06, Mark Smith <mark at maseurope.net> wrote:
> 
>>You might put the multiple results into the elements of an array, and
>>return the array.
>>
>>Mark
>>
>>On 22 Mar 2006, at 00:55, Sarah Reichelt wrote:
>>
>>
>>>On 3/21/06, Geoff Canyon <gcanyon at inspiredlogic.com> wrote:
>>>
>>>>Do you have an example? I agree that if you end up passing in a
>>>>handful of arguments by reference, you haven't accomplished much by
>>>>breaking out the routine. The question is if there isn't a better way
>>>>to slice the routine, where that wouldn't be necessary.
>>>>
>>>
>>>OK, I have a better example. Say I have a data set and I need to loop
>>>through it and extract three different pieces of information e.g. a
>>>list of the 4th column in each line, a list of lines that match a
>>>certain set of criteria, and a cumulative total obtained by adding a
>>>certain column in each line.
>>>
>>>Each of these could be done in a separate function, but that would
>>>mean looping through the data set three times. With a large data set,
>>>it is significantly faster to loop once, filling all three new
>>>variables in the single loop. If I separate this off into a separate
>>>function, then I need a way of passing multiple results back.
>>>
>>>The alternatives that I see are to use script local variables or to
>>>pass an empty parameter by reference and have the function fill it.
>>>Does anyone have any other ideas or recommendations?
>>>
>>>Sarah




More information about the use-livecode mailing list