11.10 destroy()

By means of this function any object or model in a dialog can be deleted. All children of this object are also deleted.

Definition

boolean destroy
(
      object  Object input
  { , boolean DoIt   := true input }
)

Parameters

object Object input
In this parameter the object to be deleted is specified.
boolean DoIt := true input
This optional parameter controls how the relevant object is to be deleted. If this parameter is specified as true, the object is deleted and all rule parts using this object are changed so that the corresponding commands are removed. If the object to be deleted is a model and if the second parameter is false, the model will only be deleted if it is not used by any other object. If true is given here, the model is deleted and all objects using this model refer to the next superordinate model or default.

Return value

true
The object could be deleted.
false
The object could not be deleted.

destroy() invokes the :clean() method of the object to be destroyed.

Example

dialog Destroy

default window
{
}

default pushbutton
{
}

window W1
{
  child pushbutton P1
  {
  }
}

on dialog start
{
  destroy (P1, true);
}

See also

Method :destroy()

C function DM_Destroy in manual “C Interface - Functions”

COBOL function DMcob_Destroy in manual “COBOL Interface”