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!
put the dgHilitedLines of group "TransactionList" into myLine
put the dgDataOfLine[myLine] of group "TransactionList" into myArray
put myArray["Amount"] into myAmount
I have a feeling the GetDataOfLine(theLine) function needs to work inside the DataGrid templates itself, otherwise I'm not sure. Sorry about the confusion anyway. The above will (in theory) work, if that helps.
GetDataOfLine is probably failing because you don't have it in the data grid group script or one of it's behaviors. GetDataOfLine is a function defined in the data grid itself. If you call GetDataOfLine from a card script then the function is not in the message path.
Also, thanks for the code. I had done something similar but accessing the dgText(myLine) and then grabbing the chunk I need out of it. Any advantage one way or the other between using dgText and dgDataOfLine?
dgText grabs all data from the data grid. the dgDataOfLine returns one particular record. dgDataOfLine will be faster. Also, dgDataOfLine returns an array and arrays can hold any type of data with worrying about whether or not that data contains the column separator (i.e. tab).
Thanks Trevor. I think I will convert over to dgDataOfLine. I need to get column data like this quite frequently in my app so should be pretty simple to write a function passing in the group name and column name to get the contents.
Pete