Datagrid - GetDataForLine

Marty Knapp martyknapp at
Thu Dec 8 13:07:26 EST 2011

Thank Pete - I'll play around with that.

As to my second question, I know that dealing with data in a field is 
slower than in a variable and I'm wondering if the same is true when it 
comes to custom properties?

So which is better (in a read only situation):

repeat for each line pLine in the uData of this stack --uData being a custom property
end repeat

put the uData of this stack into myVariable
repeat for each line pLine in myVariable
end repeat

I've always put the cp into a variable, but am now wondering if I'm 
wasting time/memory.

> Hi Marty,
> I believe pline is sent along with GetDataForLine and is the line number
> that the datagrid is requesting information for.  So assuming that the data
> in your custom property is in the same line sequence as the datagrid you
> would just use line pline of your custom property to populate the pDataA
> parameter of GetDataForLine.  pDataA is an array with a key named for each
> column in your datagrid.
> What I don't know is what happens if the user sorts the data in the
> datagrid by clicking on a column header because then the datagrid rows will
> not be in the same sequence as the lines in your custom property :-(
>   Normally, you'd deal with this by using the dgHIlitedIndex property of the
> datagrid but I don;t know how it works in conjunction with GetDataOfLine.
> Pete

More information about the Use-livecode mailing list