DIM Var AS Object
This datatype represents an anonymous reference to a Gambas object.
![]() | Using anonymous references is slower than using references whose class is known at compilation time. |
You create new object with the NEW keyword, or by using special instructions like OPEN that creates files, or EXEC and SHELL that creates processes.
Objects are automatically freed when they are not referenced anymore.
The freeing process is based on a reference counter stored in each object. There is no garbage collection in Gambas.
![]() | If you create a cross referencement, i.e. if an object A has a reference on an object B, that itself has a reference on A, then the objects will never be freed. |