The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



FindCells


Unit:SDL_datatable
Class: TDataTable
Declaration: function FindCells (Limit, Limit2: double; CompareOp: TCompareMode; LowCol, LowRow, HighCol, HighRow: integer; var CellList: TInt2DArray): integer;

The function FindCells searches the data table for cells whose content matches a particular inequality. The inequality is given by the parameters Limit, Limit2 and CompareOp according to the following table:

CompareOp InEquality
cmLT cell value < Limit
cmLE cell value ≤ Limit
cmGT cell value > Limit
cmGE cell value ≥ Limit
cmEQ cell value = Limit
cmNE cell value <> Limit
cmInRange (cell value ≥ Limit) and (cell value ≤ Limit2)
cmOutOfRange (cell value ≤ Limit) or (cell value ≥ Limit2)

The search range can be restricted by specifying the parameters LowCol, LowRow, HighCol and HighRow. The list of cells which match the inequality is returned in the variable array CellList. Currently the maximum number of matching cells is 10000. If more cells match the inequality only the first 10000 found cells are listed in CellList.

The function returns the following error codes:

&ge 0 ... everything is OK, the returned number is the number of found cells
-1 ... CompareOp not supported
-2 ... max. number of found cells exceeded (currently a maximum of 10000 cells is supported)

Hint 1: Setting both the low and high parameter of a dimension (i.e. LowCol and HighCol) to zero values forces the method to use all elements of that dimension.

Hint 2: Please keep in mind that the comparison is based on floating point numbers. Thus the operators cmEQ and cmNE may fail due to round-off errors if a particular floating point number cannot be represented by its exact value.



Last Update: 2023-Dec-14