data grid - getting all items in a column

Trevor DeVore lists at mangomultimedia.com
Fri May 29 09:00:58 EDT 2009


On May 29, 2009, at 1:37 AM, jim sims wrote:

> I'm in need of a working example so I get get my feeble brain into  
> using Data Grids.
>
> I have a data grid named "DataGrid 2"
> It has 2 columns - first column is named "Load" and the second  
> column is named "Workspace"
>
> What would be the exact script to place all of the items in column  
> "Workspace" into a variable so I can then work with that list of  
> items in "Workspace"?

One way:

## Get data grid array
put the dgData of group "DataGrid 2" into theDataA

## loop through multi-dimensional array and extract Workspace key
repeat with i = 1 to item 2 of line 1 of the extents of theDataA
     put theDataA[ i ]["Workspace"] & comma after theList
end repeat
delete the last char of theList

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list