1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 10:30:36 +00:00
QB64-PE/internal/help/KILL.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

35 lines
1.4 KiB
Plaintext

The [[KILL]] statement deletes a file designated by a [[STRING]] value or variable.
{{PageSyntax}}
: [[KILL]] {{Parameter|fileSpec$}}
* {{Parameter|fileSpec$}} is a literal or variable string path and filename. Wildcards * and ? can be used with caution.
::'''*''' denotes one or more wildcard letters of a name or extension
::'''?''' denotes one wildcard letter of a name or extension
* {{Parameter|fileSpec$}} can include a path that can be either relative to the program's current location or absolute, 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 Codes|error]] will result. See [[_FILEEXISTS]].
* {{InlineCode}}[[SHELL]] "DEL /Q " + fileName${{InlineCodeEnd}} does the same without a prompt or verification for wildcard deletions.
* {{InlineCode}}[[SHELL]] "DEL /P " + fileName${{InlineCodeEnd}} will ask for user verification.
* Cannot delete folders or directories. Use [[RMDIR]] to remove empty folders.
* '''Warning: files deleted with [[KILL]] will not go to the Recycle Bin and they cannot be restored.'''
{{PageExamples}}
{{CodeStart}}
KILL "C:\Qbasic\data\2000data.dat"
{{CodeEnd}}
{{PageSeeAlso}}
* [[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]]
* [[CHDIR]], [[MKDIR]], [[NAME]]
* [[_FILEEXISTS]], [[_DIREXISTS]]
{{PageNavigation}}
<