BB___KILL

=KILL= toc

Description
> Deletes the file specified by "filename". //filename// can be a literal name and extension, a string variable, or a complete path and filename. > The file must exist, otherwise you will receive a hard error.

Syntax

 * 1) kill //"filename.ext"//
 * 2) kill //fileName$//
 * 3) kill //"path\filename.ext"//

Example
code format="lb" ' A method for file deletion with safeguards.

' Get filename from user input "Name of file to delete: "; fileName$

' Ask user for confirmation to delete. confirm "Kill this file?"; ans$

' OK to delete if ans$ = "yes" then ' Trap non-existent file error on error goto [nofile]

kill fileName$ print "File has been deleted." end    ' end the program end if

' User changed his mind. Do not delete. print "File will not be deleted." print "Program ended." end        ' end the program

[nofile] print "File ";chr$(34);fileName$;chr$(34); " does not exist" print "or is not in this folder."

end code

Useful Functions
code format="lb" Place a useful function using this command here code