![]() |
![]() An Information Portal to Biological Macromolecular Structures |
|
PDB Home |
Contact Us ![]() |
![]() |
Software Tools Home | Dictionary Home | PDBML Home |
![]() |
#include "ISTable.h"
int ISTable::RemoveColumn(int colIndex);
#include "ISTable.h"
...
ISTable * pTable = new ISTable();
ReVarCifArray<CifString> last_column;
CifString cs;
while (tokenizer.hasMoreTokens()) {
cs = (char *) tokenizer.GetNextToken();
last_column.Add(cs);
cs.Clear();
}
pTable->InsertColumn(last_column, "LastColumn",
pTable->GetNumColumns());
// process the last column
processTableColumn(*pTable, pTable->GetColumnIndex(
"LastColumn"));
// erase the last column, then re-add it
pTable->RemoveColumn(pTable->GetColumnIndex("LastColumn"));
pTable->InsertColumn("LastColumn", pTable->GetNumColumns());
last_column.Clear(); // clean up array and restock with new data
while (tokenizer2.hasMoreTokens()) {
cs = (char *) tokenizer2.GetNextToken();
last_column.Add(cs);
cs.Clear();
}
// fill the column again and reprocess it, since we reinserted it.
pTable->FillColumn(last_column, pTable->GetColumnIndex(
"LastColumn"));
processTableColumn(*pTable, pTable->GetColumnIndex(
"LastColumn"));
RemoveColumn will remove the data from a column, and then remove the column itself.
colIndex | The index of the column to be removed. |
A negative value indicates an error or warning.
This method is NOT safe after index creation, but only for indices made on this column.
See also: | ClearColumn |
---|---|
DeleteColumn |