ObjectIterator

From Xojo Documentation

Revision as of 19:08, 19 November 2009 by WikiSysop (talk) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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.


Super Class

Object

Properties

Name Type Description
Current Object The current object whose TypeInfo is available.


Methods

Name Parameters Return Type Description
MoveNext 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.
Reset Sets the iterator back to its initial state so that a call to MoveNext will go to the first item in the list.


Examples

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

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


See Also

Introspection, Runtime modules; TypeInfo class.