next up previous contents
Next: AddElementToRow Up: Row methods Previous: FillRow

AppendToRow

NAME AppendToRow

PROTOTYPE

#include "SSTable.h"

int SSTable::AppendToRow(ReVarCifArray<CifString> & theRow,
                         int rowIndex);

EXAMPLE

#include "SSTable.h"

SSTable * pTable = new SSTable();
ReVarCifArray<CifString> some_row;
CifString cs;
int errCode = 0;

...//table initialization

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

if ( (errCode = pTable->AddRow()) >= 0)
  pTable->AppendToRow(some_row, pTable->GetNumRows() - 1);
else
  log_error(SSTable::GetErrorMessage(errCode));
PURPOSE

AppendToRow appends an array of CifStrings to the data of the specified row. This method is not recommended. See "Remarks" below.

RECEIVES

theRow An array of CifStrings to append to the row.
rowIndex The index of the row where the data is to be appended. Keep in mind that the first row is row 0.

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

It is not recommended to use this method. It may be unpredictable to use this method on a row with empty strings, if some of the columns are searchable. The tables destinguish "" from placeholders only if the column is searchable (since empty strings may be desired as a data element). To properly handle with this, use UpdateCell on "" and AddElementToRow if a "" does not appear (i.e. iterate over the cells in the row).



Olivera Tosic
12/17/1999