ReleaseType

This property sounds a lot more useful than we've found it. It tells you how a form was released so you can take different actions accordingly.

Usage

nReleaseType = frmForm.ReleaseType
ReleaseType gets set just before QueryUnload, so you can check it there or in the form's Destroy or Unload method.The descriptions in Help of what each value means are pretty limited. You get a ReleaseType of 1 in lots of cases, not just by clicking Close on the control menu or using the Close box. CLEAR WINDOWS or RELEASE WINDOWS sets ReleaseType to 1, too. Shutting down Windows, though, sets ReleaseType to 2.The other descriptions are closer to reality, although you don't have to actually release the variable referencing a form to get a ReleaseType of 0. Letting it go out of scope all by itself does the trick, too. Calling the form's Release method also sets ReleaseType to 0.

Example

* You might check whether you're leaving VFP entirely
* since some application actions are unnecessary in that case.
IF This.ReleaseType = 2
   WAIT WINDOW "Bye, now. Come again soon"
ENDIF

See Also

Destroy, QueryUnload, Unload


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .