returning result from a function when the number of items in the result varies
stephenREVOLUTION2 at barncard.com
Sat Sep 20 21:38:09 CDT 2008
HEY! that's not fair to the arrays. :) They REALLY are useful and amazing.
Honestly, once you have you're aha moment you'll understand it.
Your code is working as expected. For now, Just imagine the array to
be a package of little ordinary variables that can be easily
put array into fld "output" -- won't be seen
You can't "see" an array when "put" it - it's still there
but you can't put it into anything except another array (or save it
as a custom property)
put array into array2
set the customproperty[myarray] of this stack to array
If you want to see the elements you gotta take it apart.
combine does that.
combine with return and tab
which turns the array into a single text string
repeat for each line tKey in the keys of array
put tKey & return after tOut
>for some reason in my function if I say
>return myArray then I get an array with zero lines even when that is not
>If I say return myArray (where 1 is one of the keys which has data in
>the array) then it does return that correctly but just with that one line of
>This is why I hate arrays. It is not working like I expected.
>On 9/20/08, william humphrey <shoreagent at gmail.com> wrote:
>> Thanks for not only answering but giving me the example. The repeat for
> > each line in the array will work perfectly.
s a n f r a n c i s c o
- - - - - - - - - - - -
More information about the use-livecode