This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20.6
DELETE DOCUMENT

DELETE DOCUMENT 


 

DELETE DOCUMENT ( document ) 
Parameter Type   Description
document  String in Document name or Full document pathname

The DELETE DOCUMENT command deletes the document whose name you pass in document.

If the document name or the entered path name is incorrect, an error is generated. 

If the document is open when the command is called, the result depends on the OS:

  • on Windows, an error is generated,
  • on macOS, no error is generated and the document is deleted.

DELETE DOCUMENT doesn’t accept an empty string argument for document. If an empty string is used, the Open File dialog box is not displayed and an error is generated.

WARNING: DELETE DOCUMENT can delete any file on a disk. This includes documents created with other applications as well as the applications themselves. DELETE DOCUMENT should be used with extreme caution. Deleting a document is a permanent operation and cannot be undone.

The following example deletes the document named Note:

 DELETE DOCUMENT("Note") ` Delete the document

See example for the APPEND DATA TO PASTEBOARD command.

Deleting a document sets the OK system variable to 1. If DELETE DOCUMENT can’t delete the document, the OK system variable is set to 0.



See also 

Test path name

 
PROPERTIES 

Product: 4D
Theme: System Documents
Number: 159

The OK variable is changed by the commandThis command modifies the Error system variableThis command can be run in preemptive processesThis command has platform-specific behaviorThis command has platform-specific behavior

 
PAGE CONTENTS 
 
HISTORY 

Modified: 4D v6.7.1

 
ARTICLE USAGE

4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)