next up previous contents
Next: ClearColumn Up: Column methods Previous: AppendToColumn

AddElementToColumn

NAME AddElementToColumn

PROTOTYPE

#include "SSTable.h"

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

EXAMPLE

#include "SSTable.h"

SSTable * pTable = new SSTable();
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)) >= 0) {
  for (i = 0; i < some_column.Length(); i++) 
    pTable->AddElementToColumn(some_column[i], index);
} else
  log_error(SSTable::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

None  



Olivera Tosic
12/17/1999