Difference between revisions of "Runtime"

From Xojo Documentation

(See Also)
Line 23: Line 23:
  
 
<rbcode>
 
<rbcode>
Dim lastObjectIndex As Integer = Runtime.ObjectCount - 1
+
Var lastObjectIndex As Integer = Runtime.ObjectCount - 1
 
For i As Integer = 0 To lastObjectIndex
 
For i As Integer = 0 To lastObjectIndex
   Listbox1.AddRow(Str(Runtime.ObjectID(i)))
+
   Listbox1.AddRow(Runtime.ObjectID(i).ToString)
   Listbox1.Cell(ListBox1.LastIndex, 1) = Runtime.ObjectClass(i)
+
   Listbox1.CellValueAt(ListBox1.LastAddedRowIndex, 1) = Runtime.ObjectClass(i)
   Listbox1.Cell(ListBox1.LastIndex, 2) = Str(Runtime.ObjectRefs(i))
+
   Listbox1.CellValueAt(ListBox1.LastAddedRowIndex, 2) = Runtime.ObjectRefs(i).ToString
 
Next
 
Next
TextField1.Text = Str(Runtime.MemoryUsed)
+
TextField1.Value = Str(Runtime.MemoryUsed)
 
</rbcode>
 
</rbcode>
  

Revision as of 03:31, 29 July 2019

Module

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

Properties
MemoryUsed fa-lock-32.png ObjectCount fa-lock-32.png ObjectRefs fa-lock-32.png
ObjectClass fa-lock-32.png ObjectID fa-lock-32.png


Methods
IterateObjects

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:

Var lastObjectIndex As Integer = Runtime.ObjectCount - 1
For i As Integer = 0 To lastObjectIndex
Listbox1.AddRow(Runtime.ObjectID(i).ToString)
Listbox1.CellValueAt(ListBox1.LastAddedRowIndex, 1) = Runtime.ObjectClass(i)
Listbox1.CellValueAt(ListBox1.LastAddedRowIndex, 2) = Runtime.ObjectRefs(i).ToString
Next
TextField1.Value = Str(Runtime.MemoryUsed)

See Also

ObjectIterator class; System module.