RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: Cell methods Up: Row methods Previous: GetRow

GetSubRow

NAME GetSubRow

PROTOTYPE

#include "ISTable.h"
ReVarCifArray<CifString> * ISTable::GetSubRow(int rowIndex,
                                    int from, int to);

EXAMPLE

#include "ISTable.h"
extern void processRow(ReVarCifArray<CifString> *);

ISTable * pTable = new ISTable();
ISTable * pTable2 = new ISTable();
ReVarCifArray<CifString> * subrow;

... // fill up table pointed to by pTable, but leave pTable2 alone

for (int i = 0; i < pTable->GetNumRows(); i++) {
  // get left half of the rows
  subrow = pTable->GetSubRow(i, 0, pTable->GetNumColumns() / 2);
  if (subrow) {
    // process the subrow
    processRow(subrow);
    // put into the new table
    pTable2->InsertRow(*subrow, i);
  }
}
PURPOSE

GetSubRow returns as the data of a subrow an array of strings.

RECEIVES

rowIndex The index of the row.
from The index of the first column to be included in the subrow.
to The index of the last column to be included in the subrow.

RETURN VALUE

A pointer to a ReVarCifArray<CifString> that contains the data of the specified subrow.
A NULL value will be returned if an error occurs.

REMARKS

See also: GetRow



Olivera Tosic
6/12/2002

 

© RCSB PDB