Share via


DictTable.Indexnext(Int32) Method

Definition

Returns the value of the next index ID during an index iteration of the table.

public:
 virtual int Indexnext(int id);
public virtual int Indexnext (int id);
abstract member Indexnext : int -> int
override this.Indexnext : int -> int
Public Overridable Function Indexnext (id As Integer) As Integer

Parameters

id
Int32

The ID of the index for which the next index ID is being queried.

Returns

The ID of the next index in the index iteration for the table; 0 (zero) if there are no more indexes to iterate.

Remarks

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

The following example iterates through the indexes of a table.

DictTable   dt; 
DictIndex   di; 
int         counter; 
counter = 0; 
dt = new DictTable(tablenum(CustTable)); 
if (dt) 
{ 
    counter = dt.indexNext(counter); 
    while (counter) 
    { 
        di = dt.indexObject(counter); 
        if (di) 
        { 
            print strfmt("ID: %1 Name: %2", 
                         di.id(), 
                         di.name() ); 
        } 
        counter = dt.indexNext(counter); 
    } 
}

Applies to