Difference between revisions of "KILL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
Line 1: Line 1:
The '''KILL''' statement deletes a file name designated by a [[STRING]] value or variable.
+
The '''KILL''' statement deletes a path file name designated by a [[STRING]] value or variable.
  
  
Line 6: Line 6:
  
  
* Filespec can be a literal or variable string value.
+
* Filespec can be a literal or variable string path and filename.  
* The filespec can include an existing path to a different directory.  
 
 
* KILL does not ask for verification! Be careful! Don't delete empty files in the root directory or Windows!
 
* KILL does not ask for verification! Be careful! Don't delete empty files in the root directory or Windows!
* To KILL a file it MUST be [[CLOSE]]d.  
+
* To KILL a file in use, a program MUST [[CLOSE]] it first.  
* KILL does not verify that a file has been deleted. If the file did not exist, a "File not found" error will result.
+
* KILL does not ask permission or verify that a file has been deleted.  
 +
* If the path or file does not exist, a "File not found" error will result.
  
  

Revision as of 05:46, 4 January 2010

The KILL statement deletes a path file name designated by a STRING value or variable.


Syntax: KILL filespec$


  • Filespec can be a literal or variable string path and filename.
  • KILL does not ask for verification! Be careful! Don't delete empty files in the root directory or Windows!
  • To KILL a file in use, a program MUST CLOSE it first.
  • KILL does not ask permission or verify that a file has been deleted.
  • If the path or file does not exist, a "File not found" error will result.



Example: KILL "C:\Qbasic\data\2000data.dat"


See also: RMDIR, FILES, SHELL, OPEN, CHDIR, MKDIR, NAME


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage