08-04-2005 08:49 AM
08-08-2005 02:47 PM
08-09-2005 02:18 AM
Hello Wendy
Thanks for your support. The problem being resolved by using PostDeferredCall. I will also try as you have suggested. But search into the table is still an issue since i have to search for Last occurrence of the searched value. Do you have any other idea instead of search from Top to Bottom.
Regarding the memory leak i will attach the code in respective question.
Many thanks
Rakesh
08-09-2005 10:25 AM
Rakesh,
Since you can't use the GetTableCellFromValue function to search backwards, your best bet is to simply implement the search yourself. It's not difficult, especially if you know what kinds of cells and what type of data you're searching through. For example, if you're searching for text data in your table, and you're looking for exact matches, you can do something like this:
GetNumTableRows (panel, ctrl, &numRows);
GetNumTableColumns (panel, ctrl, &numColumns);
for (i = numColumns; i > 0; i--)
{
for (j = numRows; j > 0; j--)
{
PointSet (&cell, i, j);
GetTableCellValLength (panel, control, cell, &length);
nullChk(cellText = malloc (length + 1));
GetTableCellVal (panel, control, cell, cellText);
if (!strcmp (targetString, cellText))
break; // success -- break out of the loop
}
}
If you are just looking for a partial match, you can use strstr instead of strcmp. If you need to search in column-major order, simply swap the outer loop for the inner loop. If you're looking for numerical data instead, then use a numeric comparison instead. If you have cells of different types, and you need to skip some of them, you might need to interject some extra logic in these loops. If you need to search multiple times, then modify the loop to start at at a particular cell, instead of always starting at the end of the table. You get the idea.
Luis
NI
08-10-2005 02:44 AM
08-10-2005 10:11 AM
08-10-2005 10:33 AM
I have taken care Thanks 🙂
Rakesh