CRDataset::field
Previous  Index  Next

CRField& field(int index) const;
CRField& field(const CRString& name) const;

Return Value

The reference to CRField object for the specified field.

Parameters

index
Zero-based index number of the field.  
 
name
The name of the field.  

Description

Call this member function to retrieve the field when its name or its index is known. If the specified field is not found field function throws CRException exception.

Example

  CRString address;
  // get value of the field with the name address
  address = dataset1.field("Address").getString();
  // set string to the field with index 0
  dataset2.field(0).assign(address);

See Also

CRField, CRDataset::findField, CRDataset::fields, CRDataset::operator [], CRException


CRDataset | Classes | OCL | Index