3.14 DM_Destroy

Any object or model and their children within the dialog can be deleted with this function. The second parameter controls what exactly is to be deleted.

DM_Boolean DML_default DM_EXPORT DM_Destroy
(
  DM_ID objectID,
  DM_Options options
)

Parameters

-> DM_ID objectID

The ID of the object to be deleted.

-> DM_Options options

Controls the function behavior while deleting. There are the following possibilities

Option

Meaning

DMF_ForceDestroy

If you specify DMF_ForceDestroy as option, the object will be deleted and all rule parts using this object are changed. As a result the corresponding instructions will be removed. If the object to be deleted is a model and the parameter DMF_ForceDestroy is not specified here, only the repeated referencing of the model will be prohibited, but it will remain a model. However, if you indicate DMF_ForceDestroy, all models used by the objects will be removed, and the objects will take the values of the next higher model or default.

Return Value

TRUE

Object was successfully deleted.

FALSE

Object could not be deleted.

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

Example

Destroying an object out of a C function.

DM_Boolean DML_default DM_ENTRY DestroyObject

(

  DM_ID ObjID

)

{

  return (DM_Destroy(ObjID, DMF_ForceDestroy));

}

See Also

Built-in function destroy() in manual “Rule Language”

Method :destroy()