ListEnumerator.toString Method

Returns a description of the content of the element in the list that the enumerator is currently pointing to.

Syntax

public str toString()

Run On

Called

Return Value

Type: str
A string that contains a description of the current list element.

Examples

The following example creates a list, and then prints the content of the first and second elements in the list.

{ 
    List list = new List(Types::Integer); 
    ListEnumerator  enumerator; 
  
    // Add some elements to the list 
    list.addEnd(1); 
    list.addEnd(2); 
    list.addStart(3); 
  
    // Set the enumerator 
    enumerator = list.getEnumerator(); 
    // Go to beginning of enumerator 
    enumerator.reset(); 
  
    //Go to the first element in the List 
    enumerator.moveNext(); 
    // First element is 3 as this was added to start of list 
    print enumerator.toString(); 
    pause; 
  
    enumerator.moveNext(); 
    //Print second element in list (1) 
    print enumerator.toString(); 
    pause; 
}

See Also

ListEnumerator Class

ListEnumerator.definitionString Method