Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ContainerReleaseType, ContainerRelease

This property and event let you indicate what to do when the user of an ActiveDoc application navigates away from it.

Usage

acdActiveDoc.ContainerReleaseType = nLiveOrDie
nLiveOrDie = acdActiveDoc.ContainerReleaseType
PROCEDURE acdActiveDoc.ContainerRelease

Parameter

Value

Meaning

nLiveOrDie

0

When the host releases the application, open an instance of the VFP runtime and continue running there.

1

When the host releases the application, shut it down.

When you run an application in a browser, you face a unique problem. The user can abandon your application and move on to something else without explicitly quitting. This pair of members helps you solve that problem.

ContainerReleaseType lets you decide whether the application should be shut down or should keep running in the VFP runtime when the user navigates away from it. (Actually, if your browser has a cache like IE 3, this stuff doesn’t happen until the application falls out of the cache.) When the user does leave, ContainerRelease fires so you can take appropriate action.

Example

PROCEDURE ContainerRelease

* Clean up if the app is shutting down
IF This.ContainerReleaseType = 1
   This.CleanUp()  && a custom method
ENDIF

RETURN

See Also

ActiveDoc, HideDoc