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: ClearColumn Up: Column methods Previous: AppendToColumn

AddElementToColumn

NAME AddElementToColumn

PROTOTYPE

#include "ISTable.h"

int ISTable::AddElementToColumn(CifString & theElement, int colIndex);

EXAMPLE

#include "ISTable.h"

ISTable * pTable = new ISTable();
ReVarCifArray<CifString> some_column;
CifString cs;
int errCode = 0, i, index;

while (tokenizer.hasMoreTokens()) {
  cs = (char *) tokenizer.GetNextToken();
  some_column.Add(cs);
  cs.Clear();
}

cs = "LastColumn";
index = pTable->GetColumnIndex(cs.Text());

if ( (errCode = pTable->AddColumn(cs.Text())) >= 0) {
  for (i = 0; i < some_column.Length(); i++) 
    pTable->AddElementToColumn(some_column[i], index);
} else
  log_error(ISTable::GetErrorMessage(errCode));
PURPOSE

AddElementToColumn appends a CifString to the data of the specified column. The string is placed in the first available row of the column.

RECEIVES

theElement The CifString to add to the column.
colName The name of the column where the data is to be added.

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

This method is NOT safe after index creation.



Olivera Tosic
6/12/2002

 

© RCSB PDB