Sub Arrays using keys

Jan Schenkel janschenkel at yahoo.com
Tue Mar 30 15:43:39 EST 2004


--- Glen Bojsza <gbojsza at mac.com> wrote:
> I was wondering if it is possible to create separate
> sub arrays based 
> on the keys of the parent array?
> 
> One thing to watch for is that the data in the field
> columns may not be 
> unique and so this eliminates them from being used
> with the split 
> command.
> 
> --snip--
> 
> put fld "bigData" into tsarray
> put 1 into z
>    put 1 into b
> 
>    repeat for each line j in mycagg -- determines
> the columns of the 
> field to build the parent array
> 
>      put line z of myaggvar into aname -- determines
> the name of the 
> keys for each sub array
> 
>      repeat for each line L in tsarray descending
>        put item (word 1 of j) of L & cr after
> aname[b,z]  -- builds 2D 
> array
>        put b + 1 into b
>      end repeat
>      put z + 1 into z
>    end repeat
> 
> 
> or should the line for the 2D array be
> 
> put item (word 1 of j) of L & cr after
> myArray[aname]
> 
> The overall idea is to :
> 
> 1. create individual arrays from a large data field
> 2. determine the start and ending row number in a
> time array based on a 
> user selected range
> 3. gather the data from the range of rows from the
> other sub arrays and 
> manipulate
> 
> Of course all the arrays will be identical in
> length.
> 

Hi Glen,

I think you'l have better luck with :
  do ("put item (word 1 of j) of L & cr after" \
     && aname & "[b,z]")

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html


More information about the use-livecode mailing list