getting info from a Data Grid - which out of three methods is best?

Jim Sims sims at ezpzapps.com
Wed Apr 7 19:14:21 EDT 2010


On Apr 7, 2010, at 11:03 PM, Josh Mellicker wrote:

> Imagine you have a Data Grid with data (perhaps 30 - 50 lines).
> 
> Now, you want to find all lines where 3 certain columns match given values. Example: you want to find all lines where columnName "firstName" = "Trevor", "food" = "salad", and "meal" = "lunch".
> 
> 
> Would you:
> 
> 1. scan the grid line by line, trying for a value match with data grid commands?
> 
> 2. get the dgData and loop through the array?
> 
> 3. get the dgText and loop through the tab delimited data?



I'm assuming that I am planning on setting up code for an application with this question.

Number one is not something one would want to have in an app, depending upon the user is bad form.

I would get the dgData array and dgIndexes and then loop through the records of the array. 

Note that Trevor has a really great web based help system for the datagrids which will save countless hours when trying to understand how to use datagrids.

Regards,
sims





More information about the use-livecode mailing list