.. highlightlang:: us .. index:: DocDestroy .. _docdestroy: DocDestroy ========== .. us.tag DocDestroy ENGLISH Changed5410 :ref:`DocDestroy` closes the given document, frees any memory that the document occupied and destroys the document handle. .. function:: bool = DocDestroy(hDoc) bool = DocDestroy(hDoc, options) .. us.return **Return Value** If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: hDoc Identifies the document. .. uparam:: options The *options* parameter sets the packing option for IPZ files. The parameter has no meaning for IPW files. .. list-table:: :header-rows: 1 * - Value - Description * - DOC_CLOSE_DEFAULT (0) - Default. During closing of an IPZ file the registry setting ``Settings\ipz-pack-on-close`` will be evaluated. If the value is not specified or set to 1 the file will be packed in an external process. * - DOC_CLOSE_NOPACK (1) - No packing. The file will be closed and it can immediately accessed by any process. * - DOC_CLOSE_PACK_EXTERNAL (2) - External process will pack the file. While the external process is running the file cannot be accessed. * - DOC_CLOSE_PACK_INTERNAL (3) - Internal process will pack the file. .. us.comment **Comment** * IPZ files are almost always smaller than IPW files, because the data is compressed. * It has no speed impact on opening or editing an IPZ file, if the file is compacted or not. * During compacting an IPZ file, duplicate data streams are removed. For example if a file contains two datasets, which use the same x-channels, one of the two x-channles will be removed. Two channels are identical, if all values in the channels are identical. In a second step, all unused elements like pages, datasets, bitmaps, maps and OLE objects will be removed. .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2012.10 - New parameter *options*. .. seealso:: :ref:`overview-documents`, :ref:`DocCreate` :sub:`id-1109992`