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:

  1. Fires the valid event of the current object. If it returns a value of false, the form doesn't close.

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( ).