![]() |
![]() An Information Portal to Biological Macromolecular Structures |
|
PDB Home |
Contact Us ![]() |
![]() |
Software Tools Home | Dictionary Home | PDBML Home |
![]() |
#include "ISTable.h"
int ISTable::InsertColumn(const char * newColumnName,
int destination,
char opts = DEFAULT_OPTIONS);
int ISTable::InsertColumn(ReVarCifArray<CifString> & theCol,
const char * newColumnName,
int destination,
char opts = DEFAULT_OPTIONS);
#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();
}
// put a column in 1st position ...
pTable->InsertColumn("FirstColumn", 0);
pTable->InsertColumn(last_column, "LastColumn",
pTable->GetNumColumns());
pTable->InsertColumn("MiddleColumn", pTable->GetNumColumns()/2,
ISTable::DT_INTEGER);
InsertColumn inserts a column into the table at a specified location. The second form of this method also adds data into the table. The first form of the method requires calling another method, such as FillColumn, to add data to the table.
newColumnName | The name of the new column. The column name must be unique to the table. |
destination | The index where the column is to be placed. Keep in mind that the first column is column 0. |
opts | Sets the options for the column. These include the datatype, case sensitivity, and white space sensitivity for comparisions. Has a default value indicating a column of strings, with case and white space sensitivity. |
theCol | An array of CifStrings to add as the data of the column. Even if the datatype of the column is not of string type, it needs to be put into the table as CifStrings. |
newColumnName | The name of the new column. The column name must be unique to the table. |
destination | The index where the column is to be placed. Keep in mind that the first column is column 0. |
opts | Sets the options for the column. These include the datatype, case sensitivity, and white space sensitivity for comparisions. Has a default value indicating a column of strings, with case and white space sensitivity. |
A negative value indicates an error or warning.
It is safe to use this method after index creation.
See also: | FillColumn |
---|---|
Column Option Constants |