Arbortext Command Language > Functions by Alphabetical Listing > doc_close
  
doc_close
doc_close (doc)
This function frees all memory used to represent the document tree identified by doc and marks the document identifier as invalid. You should not use the document specified by doc after you call this function. You cannot use doc to specify a command window document; for example, doc_close(window_doc("cmd")) is illegal. The function returns 1 on success, 0 on failure.
doc_close prompts you to save the document if the document is attached to an edit class window and has been modified. The doc_close function returns 0 if the user selects Cancel on the Save dialog box. To avoid a prompt in this case, a save or set modified=off command should be done before calling doc_close.
If doc specifies a document in a window not created by the window_create function, for example an auxiliary help window created by the help command, doc_close also removes the window. For example, doc_close(window_doc("helpwin2")) would free the document tree representing the contents of the helpwin2 window, and destroy the helpwin2 window.