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: Row methods Up: Column methods Previous: GetColumn

GetSubColumn

NAME GetSubColumn

PROTOTYPE

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

EXAMPLE

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

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

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

colNames = pTable->GetColumnNames();
for (int i = 0; i < pTable->GetNumColumns(); i++) {
  // get upper half of the column
  subcol = pTable->GetSubColumn(i, 0, pTable->GetNumRows() / 2);
  if (subcol) {
    // process the subcolumn
    processColumn(subcol);
    // put into the new table
    pTable2->InsertColumn(*subcol, (*colNames[i]).Text(), i);
  }
}
PURPOSE

GetSubColumn returns an array of strings representing a subcolumn of data.

RECEIVES

colIndex The index of the column.
from The index of the first row to be included in the subcolumn.
to The index of the last row to be included in the subcolumn.

RETURN VALUE

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

REMARKS

See also: GetColumn



Olivera Tosic
6/12/2002

 

© RCSB PDB