CPCURRENT()

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


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net