Difference between revisions of "KILL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 6: Line 6:




* Filespec is a literal or variable string path and/or filename. Path is relative to program's current location.
* Filespec is a literal or variable string path and filename.  
* Path can be relative to program's current location or use an absolute path from the root drive.
* KILL cannot remove an [[OPEN]] file. The program MUST [[CLOSE]] it first.   
* 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 Codes|error]] will result.
* If the path or file does not exist, a "File not found" or "Path not found" [[ERROR Codes|error]] will result.
Line 13: Line 14:




''Example:'' KILL "C:\Qbasic\data\2000data.dat"
''Example:''  
 
{{CodeStart}}
 
KILL "C:\Qbasic\data\2000data.dat"
 
{{CodeEnd}}





Revision as of 01:37, 4 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 filename.
  • Path can be relative to program's current location or use an absolute path from the root drive.
  • 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