Using the GetDataOfLine function out of the message path?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am

Using the GetDataOfLine function out of the message path?

Post by keithglong » Thu Dec 08, 2011 6:24 am

Hi All,

The LiveCode_Data_Grid.pdf manual states:
You need to keep in mind that GetDataOfLine (and GetDataOfIndex) is a function defined for a Data Grid. That means that the Data Grid group MUST be in the message path. If the Data Grid group is not in the message path you would need to use the call command.
Would anyone out there be able to provide an example of this? I need to be able to get the data from a line in a Data Grid form when clicking on a button that is not part of the Data Grid...

I know how to get the data when the Data Grid group is in the path as follows:

Code: Select all


on mouseUp
   put the dgHilitedLines of me into theLine
   put GetDataOfLine(theLine,"FilePath") into thePic
   launch document thePic   
end mouseUp

Thanks,

- Boo

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Using the GetDataOfLine function out of the message path?

Post by dunbarx » Thu Dec 08, 2011 3:32 pm

Hi.

Why not just:

on mouseUp
get the dgDataOfLine[2] of grp "yourDG"
combine it with return and tab
answer it
end mouseUp

Craig Newman

keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am

Re: Using the GetDataOfLine function out of the message path?

Post by keithglong » Thu Dec 08, 2011 8:28 pm

Thanks Craig! Still learning my way around... ;-)

Post Reply