Runtime

From Xojo Documentation

Revision as of 19:04, 19 November 2009 by WikiSysop (talk) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!


Description

Returns information about the current state of the runtime environment. This information can be useful for debugging purposes.


Properties

Name Type Parameters Description
MemoryUsed Integer Returns the total amount of memory used (in bytes) by the allocated objects.
ObjectClass String Index as Integer ObjectClass returns the class of the passed object.

It takes ObjectNumber as its parameter, where ObjectNumber is greater than or equal to zero and less than ObjectCount.

ObjectCount Integer Returns the current number of objects in existence.
ObjectID Integer Index as Integer ObjectID returns a unique identifier for the passed object.

It takes ObjectNumber as its parameter, where ObjectNumber is greater than or equal to zero and less than ObjectCount.

ObjectRefs Integer Index as Integer ObjectRefs returns the number of references to the passed object.

It Takes ObjectNumber as its parameter, where ObjectNumber is greater than or equal to zero and less than ObjectCount.


Methods

Name Parameters Return Type Description
IterateObjects
Introduced 2008r4
Runtime.ObjectIterator Iterates over the objects in the runtime environment. Use it to get the TypeInfo for each object. See the ObjectIterator class for an example.


Examples

The following code displays the properties related to individual objects in a multicolumn ListBox and the total amount of memory used in a TextField:

Dim i, total as Integer
total=Runtime.ObjectCount
For i=0 to total-1
Listbox1.addrow Str(Runtime.ObjectID(i))
Listbox1.Cell(ListBox1.LastIndex,1)=Runtime.ObjectClass(i)
Listbox1.Cell(ListBox1.LastIndex,2)=Str(Runtime.ObjectRefs(i))
Next
TextField1.text=Str(Runtime.memoryUsed)


See Also

ObjectIterator class; System module.