Class

ObjectIterator


Description

Used to iterate over the active objects at runtime. Use the Introspection system to get information on the active objects. Note that ObjectIterator is a Public class of the Runtime module.

Properties

Name

Type

Read-Only

Shared

Current

Object

Methods

Name

Parameters

Returns

Shared

MoveNext

Boolean

Reset

Property descriptions


ObjectIterator.Current

Current As Object

The current object whose TypeInfo is available.

This property is read-only.

This call to Current gets the Name of the object.

Var o As Runtime.ObjectIterator = Runtime.IterateObjects
o.Reset
While o.MoveNext
  ListBox1.AddRow(Introspection.GetType(o.Current).Name)
Wend

Method descriptions


ObjectIterator.MoveNext

MoveNext As Boolean

Moves the iterator to the next object. MoveNext must be called to start the iteration. You can think of the iterator as initially pointing to prior to the first item in the list.

The following example iterates over the objects using a While loop and writes each object's name to a DesktopListBox.

Var o As Runtime.ObjectIterator = Runtime.IterateObjects
While o.MoveNext
  ListBox1.AddRow(Introspection.GetType(o.Current).Name)
Wend

ObjectIterator.Reset

Reset

Sets the iterator back to its initial state so that a call to MoveNext will go to the first item in the list.

The following example iterates over the objects using a While loop and writes each object's name to a DesktopListBox.

Var o As Runtime.ObjectIterator = Runtime.IterateObjects
o.Reset
While o.MoveNext
  ListBox1.AddRow(Introspection.GetType(o.Current).Name)
Wend

Sample code

The following example iterates over the objects using a While loop and writes each object's name to a DesktopListBox.

Var o As Runtime.ObjectIterator = Runtime.IterateObjects
While o.MoveNext
  ListBox1.AddRow(Introspection.GetType(o.Current).Name)
Wend

Compatibility

All project types on all supported operating systems.

See also

Object parent class; Introspection, Runtime modules; TypeInfo class.