close( )
Closes a form.
Syntax
<oRef>.close([expX])
<oRef>
An object reference to the form to close.
<expX>
An optional value to be returned by a form opened with readModal( )
Property of
Form, SubForm
Description
Use close( ) to close an open form or report. Modal forms (forms opened using the readModal( ) method) may optionally return a value to the calling form or program. The returned value may be of any data type.
When you try to close a form, dBASE Plus does the following:
Fires the valid event of the current object. If it returns a value of false, the form doesn't close.
Fires the onLostFocus event of the current object.
Fires the canClose event of the form. If it returns false, the form doesn’t close.
Fires the onLostFocus event of the form.
Removes the form and the objects it contains from the screen.
Fires the onClose event of the form.
Removes the form from memory if there are no other object references pointing to the form.
When a form is closed with close( ) or by clicking the Close icon, any pending changes in the record buffer are saved, as if saveRecord( ) was called. Closing a form by pressing Esc abandons changes before closing (if escExit is true).
close( ) returns false if the form was not closed successfully. If the form definition is not removed from memory, you can open the form again with open( ).