lang • type • object


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 a new object with the NEW keyword, or by using special instructions like OPEN that creates files, or EXEC and SHELL that create 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 reference, 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. In that case, you will get a "circular references" warning message at program exit.

See also