Difference between revisions of "KILL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 1: Line 1:
The '''KILL''' statement deletes a path file name designated by a [[STRING]] value or variable.
+
The '''KILL''' statement deletes a file on a relative path designated by a [[STRING]] value or variable.
  
  
Line 6: Line 6:
  
  
* Filespec can be a literal or variable string path and filename.  
+
* Filespec is a literal or variable string path and/or filename. Path is relative to program's current location.
* KILL does not ask for verification! Be careful! Don't delete empty files in the root directory or Windows!
+
* KILL cannot remove an [[OPEN]] file. The program MUST [[CLOSE]] it first.
* To KILL a file in use, a program MUST [[CLOSE]] it first.  
+
* If the path or file does not exist, a "File not found" or "Path not found" [[ERROR Codes|error]] will result.
* KILL does not ask permission or verify that a file has been deleted.
+
* '''WARNING: Use this statement carefully! There is no prompt for permission to continue!'''
* If the path or file does not exist, a "File not found" error will result.
 
 
 
  
  
Line 19: Line 17:
  
  
''See also:'' [[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]], [[CHDIR]], [[MKDIR]], [[NAME]]
+
''See also:''  
  
 +
[[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]]
  
 +
[[CHDIR]], [[MKDIR]], [[NAME]]
  
==Navigation:==
 
  
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
 
  
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]
+
{{PageNavigation}}

Revision as of 19:29, 3 July 2010

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


Syntax: KILL filespec$


  • Filespec is a literal or variable string path and/or filename. Path is relative to program's current location.
  • KILL cannot remove an OPEN file. The program MUST CLOSE it first.
  • If the path or file does not exist, a "File not found" or "Path not found" error will result.
  • WARNING: Use this statement carefully! There is no prompt for permission to continue!


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


See also:

RMDIR, FILES, SHELL, OPEN

CHDIR, MKDIR, NAME




Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page