next up previous contents index
Next: Zoidlists Up: Data Types Previous: Pointers   Contents   Index

Handles

Several of the interface functions return ``handles'', which are variables which contain a reference to a complex data object. The handles are in turn passed to other functions which operate on the referenced data object. When through with a handle, it should be closed (with the Close function) to free the memory used by the data object. If passed to the Print family of functions, a string giving the type of handle will be printed.

There are many different types of data object that can be accessed with a handle, some examples being:

string lists
database objects
file descriptors
properties
With a few exceptions, notably the file descriptor, a handle generally points to a list of objects, such as the currently selected objects, that can be iterated through. Once the iteration is complete, the handle is automatically closed, and further references will not reference an object.

See the section on math operators (13.3) for a discussion of the operations available on handles.

The HandleContent function can be called on any handle, and will return the number of objects that can be referenced through the handle. Zero is returned when the handle has iterated to completion. This function is useful in loops which contain iterations over handles.

If a handle still contains references but it is no longer needed, the Close function should be called on the handle to free internal resources.


next up previous contents index
Next: Zoidlists Up: Data Types Previous: Pointers   Contents   Index
Stephen R. Whiteley 2006-10-23