data grid - getting all items in a column

Jim Sims sims at ezpzapps.com
Fri May 29 09:43:38 EDT 2009


On May 29, 2009, at 3:00 PM, Trevor DeVore wrote:

> 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

Thanks Trevor, I suspect you already extremely busy so answering  
questions here is extra duty for you. Much appreciated.

The above only gets me commas with no data.

I can use:      put the dgText   of group "DataGrid 2B"

which gets me the following (the "true" items are checkboxes) tab  
delimited list:

true	Communication
true	Graphics/Images
true	Development
	Last shutdown
	AppBoot Dev
	XhoutOut

I can slice that up, but suspect I'm missing the boat on how this all  
works.

I can use dgText and am going to use only small lists of data in my  
data grid right now so spending any time with me on this is not  
crucial for me if you are too busy.

thanks,
sims




More information about the use-livecode mailing list