![]() |
![]() An Information Portal to Biological Macromolecular Structures |
|
PDB Home |
Contact Us ![]() |
![]() |
Software Tools Home | Dictionary Home | PDBML Home |
![]() |
#include "ISTable.h"
int ISTable::GetColumnIndex(const char * columnName);
#include <string.h>
#include <stdlib.h>
#include "ISTable.h"
extern char ** ConvertRVCACifString(ReVarCifArray<CifString>*);
ISTable * pTable = new ISTable("MyTable");
... // add some columns and stuff
ReVarCifArray<CifString> * cifarray = pTable->GetColumnNames();
char ** colNames = ConvertRVCACifString(cifarray);
// sort the names
qsort(colNames, pTable->GetNumColumns(), sizeof(char *), strcmp);
// do something to each column, alphabetically
for (int i = 0; i < pTable->GetNumColumns(); i++) {
int index = pTable->GetColumnIndex(colNames[i]);
...
}
GetColumnIndex returns the index of the column with the given name.
columnName | The name of the column. |
An integer representing the position of the column in the table. For example, an index of 0 represents the 1st column.
A negative value means that an error has occured, i.e. the column with the specified name was not found in the table.
None |