next up previous contents
Next: ConstrainColumnGreaterThanEqual Up: Searching Methods Previous: ConstrainColumnLessThanEqual

ConstrainColumnGreaterThan

NAME ConstrainColumnGreaterThan

PROTOTYPE

#include "SSTable.h"

ReVarPCifArray<int> * SSTable::ConstrainColumnGreaterThan(
                                 CifString & target,
                                 CifString & colName,
                                 int & errCode);

EXAMPLE

#include "SSTable.h"

CifString cs("0.00"), col1("twist");
int errCode = 0;
SSTable s("MyTable");
...
s.SetFlags(SSTable::DT_DOUBLE, s.GetColumnIndex(col1.Text()));
s.SetPrecision(2, s.GetColumnIndex(col1.Text()));

ReVarPCifArray<int> * iArray;
iArray = s.ConstrainColumnGreaterThan(cs, col1, errCode);
if (iArray) {
  for (int i = 0; i < iArray->Length(); i++) {
    // do something to each row with twist > 0.00
  }
}
PURPOSE

ConstrainColumnGreaterThan returns the row indices of cells in a column that are greater than the target value. You can only search a column that was constructed with a tree index. The search is dictated by the datatype of the column, since, strings, integers, and doubles get compared differently.

RECEIVES

target The target value to compare to.
colName The name of the column to search.
errCode A reference to an integer holding the error code resulting from this operation.

RETURN VALUE

A pointer to a ReVarPCifArray<int> holding the row indices of the cells containing a value greater than the target.
A NULL value indicates a possible error or an unsuccessful search.
A negative value in errCode indicates an error or warning.

REMARKS

See also: ConstrainColumnGreaterThanEqual



Olivera Tosic
12/17/1999