Difference between revisions of "KILL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 3: Line 3:
  
  
:::::''Syntax:'' KILL filespec$
+
{{PageSyntax}}
 +
:: KILL filespec$
  
  
Line 17: Line 18:
  
 
''Example:''  
 
''Example:''  
 
 
{{CodeStart}}
 
{{CodeStart}}
 
 
KILL "C:\Qbasic\data\2000data.dat"
 
KILL "C:\Qbasic\data\2000data.dat"
 
 
{{CodeEnd}}
 
{{CodeEnd}}
 
  
  
 
''See also:''  
 
''See also:''  
 
 
* [[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]]
 
* [[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]]
 
 
* [[CHDIR]], [[MKDIR]], [[NAME]]
 
* [[CHDIR]], [[MKDIR]], [[NAME]]
 
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Revision as of 22:58, 9 May 2011

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. Wildcards * and ? can be used but be careful!
  • 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.
  • SHELL "DEL /Q " + filename$ does the same without a prompt or verification for wildcard deletions.
  • SHELL "DEL /P " + filename$ will ask for user verification.
  • WARNING: Use this statement carefully! There is no prompt for permission to continue and deletes are permanent!


Example:

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


See also:



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