Futurebasic/Language/Reference/kill field

From Wikibooks, open books for an open world
Jump to navigation Jump to search

KILL FIELD[edit | edit source]

Syntax[edit | edit source]

KILL FIELD handle&

Description[edit | edit source]

This statement disposes of the specified handle. This means that the memory block referenced by handle& gets released, and the value in handle& is thereafter no longer a valid handle. KILL FIELD is commonly used with handles returned by GET FIELD or READ FIELD, but it can dispose of any kind of handle. However, you should specifically NOT use it to dispose of resources, regions, window controls, and other "standard" kinds of Macintosh objects which are created and managed by the MacOS. Instead, you should use the appropriate Toolbox routine (ReleaseResource, DisposeRgn, DisposeControl, etc.) to dispose of such objects.

KILL FIELD is similar to the Toolbox call DisposeHandle, except that it (like the DEF DISPOSEH statement) checks for _nil handles and sets the handle& variable to zero.

See Also[edit | edit source]

DEF DISPOSEH; GET FIELD; READ FIELD; SYSERROR