Page 1 of 1

Find in a DataGrid

Posted: Thu Oct 18, 2012 5:34 pm
by lohill
The following quote describes the different forms of the Find command that works for fields on a card:
The six forms of the find command search in different ways. The find normal, find chars, and find words forms search for each word in the textToFind, but the words don't have to be together to be found; they only have to all appear on the same card. The find words and find wholeforms look for complete words only. The find string and find whole forms search for the textToFind as a unit.
This actually works for the fields in a DataGrid but in such s 'random' way as to be useless. There are datagrid commands FindIndex and FindLine that will find the date in a particular column if there is an exact match. Is there any way to find the index or line in the datagrid when you want other than an exact match?

Larry

Re: Find in a DataGrid

Posted: Sat Oct 20, 2012 4:56 pm
by lohill
Well, it is not pretty but it works and I am always surprised at how quickly LiveCode can do it. I am using a brute force method by putting the dgText of the DataGrid into a variable and then looping through all the lines looking at the offset of the characters I want to find. I use global variables for the search argument and the last line found so that 'next' searches can continue where the last left off. My DataGrid has almost 2500 rows and searches take almost no time.

Larry