Table of Contents

DESTROY method (System)

Description

Destroys a specified object, optionally removing it from the Window Common Area if appropriate.

Syntax

bDestroyed = Exec_Method( "SYSTEM",

                           "DESTROY",      
                           ObjectID,       
                           CommRemoveFlag )

Parameters

NameRequiredDescription
ObjectIDYesID of the object to be destroyed.



If this is "SYSTEM" then the Presentation Server will close the current application and exit. Use this to programmatically shut down the system.
CommRemoveFlagNoIf TRUE$ then the object is removed from the Window Common area if appropriate (see remarks below). Defaults to FALSE$

Returns

TRUE$ if the object was destroyed successfully, FALSE$ otherwise.

Remarks

If the object to be destroyed is a control hosted on a form then some extra details, such as database and validation information, are stored in an area of memory called the "Window Common Area". Setting the "CommRemoveFlag" to TRUE$ removes this information as well.

Do not use this method to close a form - use the CLOSE event or an appropriate function such as End_Dialog instead.

The following intrinsic objects cannot be destroyed with the SYSTEM DESTROY method:

• CLIPBOARD

• FILESYSTEM

• SYSTEMMONITOR

Note that there also are other "sub-objects", such as IMAGE, GLYPH, and TABS etc., which are managed by their respective owners and cannot be destroyed directly by the SYSTEM DESTROY method. This behavior will be noted in the individual sections detailing them.

Example

 
$Insert Logical

   

   // Destroy a control on a form and ensure data is removed

   // from the window common area

   

   ObjectID = @Window : ".EDL_NAME"

   Call Exec_Method( "SYSTEM", "DESTROY", ObjectID, TRUE$ )

   

   // Close the application

   Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )
 
 
 

See Also

N/A