fires before the object has been released and is about to be destroyed.

Property of

Most dBASE form and data objects.

Description

Use beforeRelease to perform any extra manual cleanup, if necessary, before an object is released. beforeRelease fires when an object is about to be destroyed.

beforeRelease will fire under the following conditions:

The order in which beforeRelease() fires for a Form and its contained objects is not strictly in the order in which these objects are released. In some cases, beforeRelease() will fire sooner than an object's actual release when it is notified by its parent object or by its associated datamodule, database, query, or storedproc object that it will soon be released.

The order in which objects on a form are actually released has not been changed from earlier versions of dBASE Plus except for subforms. Subform release has been moved from near the end of the release process up to the beginning of the release process.

One other change made is that removal of a form's code from memory has been moved later in the release process so that it occurs after all objects on the form have been released.
This is to prevent CLASS NOT FOUND errors that would otherwise occur if an object's beforeRelease property is set to a method of its form.

Here is the firing order for beforeRelease() when a form (or subform) is being released:

  1. Subforms (if any)

  2. Form Components contained in the form's elements array property (this includes any Contaner and Notebook objects and their contained objects)

  3. Menubar assigned to Form's menufile property

  4. Popup assigned to Form's popupmenu property

  5. Form

  6. Database (parented by the form). Each Database object (in turn) notifies any associated Query and StoredProc objects which in turn, notify their Rowset objects.

  7. Any other objects assigned to properties or custom properties of the form and that are not in the form's elements array property.  This includes: