The following example shows how to use the GetFirstField method to return a pointer to the first ECLField object in the collection.

// ECLFieldList::GetFirstField
// Display starting position of every input (unprotected) field.
void Sample41() {
ECLPS        *PS;           // Pointer to PS object
ECLFieldList *FieldList;    // Pointer to field list object
ECLField     *Field;        // Pointer to field object
try {
  PS = new ECLPS('A');                // Create PS object for 'A'
  FieldList = PS->GetFieldList();     // Get pointer to field list
  FieldList->Refresh();               // Build the field list
  // Interate over (only) unprotected fields
  printf("List of input fields:\n");
  for (Field = FieldList->GetFirstField(GetUnprotected);
    Field != NULL;
    Field = FieldList->GetNextField(Field, GetUnprotected)) {
    printf("Input field starts at %02lu,%02lu\n",
            Field->GetStartRow(), Field->GetStartCol());
  delete PS;
catch (ECLErr Err) {
  printf("ECL Error: %s\n", Err.GetMsgText());
} // end sample