DictTable.fieldNext Method

Returns the value of the next field ID during a field iteration of the table.

Syntax

public FieldId fieldNext(FieldId fieldId, [TableScope tableScope])

Run On

Called

Parameters

Return Value

Type: FieldId Extended Data Type
The ID of the next field in the field iteration for the table; 0 (zero) if there are no more fields to iterate.

Remarks

The value of the fieldId parameter should evaluate to 0 (zero) to start the field iteration, and the return value should be used for subsequent calls to the iteration.

Examples

The following example iterates through the fields of a table.

DictTable   dt; 
DictField   df; 
int         counter; 
 
counter = 0; 
 
dt = new DictTable(tablenum(CustTable)); 
if (dt) 
{ 
    counter = dt.fieldNext(counter); 
    while (counter) 
    { 
        df = dt.fieldObject(counter); 
        if (df) 
        { 
            print strfmt("ID: %1 Name: %2", 
                         df.id(), 
                         df.name() ); 
        } 
        counter = dt.fieldNext(counter); 
    } 
}

See Also

DictTable Class

DictField Class

DictTable.fieldObject Method