DESTROY


7.8.5, PLBCMP GUI Only

 

The DESTROY instruction removes an item from the screen and release the data structures obtained for an object during a CREATE instruction. The instruction uses the following format:

 

 

[label]

DESTROY

{object}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A previously defined and created object or a pointer to an object that is destroyed.

Flags Affected: NONE

Note the following:

  1. DESTROY is valid for all object variable types.

  2. If the object is currently active, it is deactivated prior to the actual destroy operation.

  3. All data structures used by the object are released.

  4. An attempt to DESTROY an object before it has been CREATEd results in the instruction being ignored.

  5. When a 'DESTROY PLBOBJECT' statement is executed, the PL/B runtime invokes/executes the 'ClassDestroy' FUNCTION in the CLASSMODULE associated with the PLBOBJECT object. The 'ClassDestroy' function is not executed when a PLBOBJECT object is destroyed implicitly during a CREATE, STOP or SHUTDOWN operation. The 'DESTROY PLBOBJECT' operation unloads and frees memory for the CLASSMODULE created for the PLBOBJECT.

 

 

See Also: Example Code, CREATE, Object Instructions

 



PL/B Language Reference DELETEITEM DISABLEITEM