Datagrid - GetDataForLine

Pete pete at mollysrevenge.com
Wed Dec 7 21:03:22 EST 2011


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

On Wed, Dec 7, 2011 at 5:27 PM, Marty Knapp <martyknapp at comcast.net> wrote:

> Hi all,
> Just got back to this after being away for a few days (celebrating my
> anniversary! For some weird reason "GetDataForLine" just wasn't on my mind
> . . .) And thanks to everyone who has chipped in on this.
>
> So how is pLine derived when using GetDataForLine? Do I supply that or
> does the datagrid supply/keep track of it? I'm assuming that when you hook
> this up to a database that you're able to bookmark where you left off, but
> what about when feeding it from a tab-delimied list from a custom property?
> (and yes, I know I need to dive into learning database stuff and have been
> eying SQLYoga. But I have a project I need to get working ASAP.)
>
> BTW (and this may be a dumb question) when accessing data in a custom
> property (read only) should one first put it into a variable or is it OK to
> access it directly? In other words is there anything wrong with this:
>
> repeat for each line pLine in the uData of this stack
>   dostuff
> end repeat
>
> Any speed or memory issues?
>
> Thanks again,
> Marty K
>
>> Marty, I am no expert but let me share what I have learned over the past
>> few weeks.
>> Don't be too concerned about the database examples.   Look at the message
>> handler carefully.
>>
>> command GetDataForLine pLine, @pDataA
>>
>>
>>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>
>


-- 
Pete
Molly's Revenge <http://www.mollysrevenge.com>



More information about the use-livecode mailing list