Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.2 Online Documentation (MoTW) Revision 3

Delete an Object (dbo_delete_object.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Delete an Object

A DataBasic object (DBO) only contains a reference to the actual object, and a reference count is maintained for each object. When a DBO is deleted, the reference is deleted and the count decremented. The external object is only deleted once all references to it have been deleted.

DBOs are automatically deleted when variables are reassigned or go out of scope - as in local subroutine and user function variables after it is exited by a return statement. In addition, all DBOs saved in local variables are deleted when the program ends.

Any DBOs saved in common and named common will persist for the duration of the common variable.

Syntax

OBJ1 = expression

Comments

As the system automatically maintains and deletes references to the objects, it is not necessary for the programmer to manually delete DBOs. However, it is good practice to delete a DBO when it is no longer needed in large complex applications, so that the object is not retained unnecessarily.

Deleting a connection object will not affect current language server objects using the connection. The connection will only be closed when all language server objects using it have been deleted.

Examples

OBJ1 = "" Assign the null string to the variable OBJ1, deleting anything it had in it - e.g. a DBO.
OBJ1 = 2 Assign the number 2 to the variable OBJ1, deleting anything it had in it - e.g. a DBO.

RealityV15.2Revision 3Comment on this topic