IDL_Object::_overloadForeach

The IDL_Object::_overloadForeach function method retrieves the value of the next object element.

Tip: If you write an object class that inherits from IDL_Object and overloads this method, you can call the superclass method directly to achieve the default behavior for specific cases.

Syntax

In most cases, this method is called by IDL when an object is used as the variable in a FOREACH statement. When called explicitly, the syntax is:

Result = Obj->[IDL_Object::]_overloadForeach( Value, Key, )

Return Value

The method returns 1 if there is a current element to retrieve, and 0 if there are no more elements.

Arguments

Value

This output variable should be set to the value of the current object element. If Init is 1 (TRUE), you should set Value to the value of the first object element.

Key

This output variable should be set to the index (or key) associated with the current element. In the first iteration, Key is undefined.

Routine Signature

To overload an object class to utilize the FOREACH statement, implement a method with the following signature:

FUNCTION class::_overloadForeach, Value, Index

The return value of this function should be 1 if there is a current element to retrieve, and 0 if there are no more elements.

Version History

8.0

Introduced

See Also

FOREACH