Removes a file from disk; or lines from a program; or an object from memory
Implemented by: ansifull, decbasic, altair12K, Applesoft, TI994, cbmv7, cbmv3.5, level2, BBC, bw32, ABasiC
With variations: hptsb, VBDOS (ISAM instruction), bwbasic, MSX, GWBASIC (program edition), FreeBASIC (destroy an object)
Also written as:
ECMA's FullBASIC standard defines DELETE as a file-related operation, even though in many commercial and popular BASICs the keyword was already in use as an edition command.
GWBASIC and MSX BASIC use DELETE as an editor command in order to remove a range of lines of the program in memory. Watch out: if only one line number is given, DELETE will remove every line from there onwards; if the line number is prefixed by "-", it will remove all lines before and including the given line. A period (.) can be used as a substitute for the last edited line.
In Bywater BASIC DELETE can be used to remove one line or a range of lines of the program in memory, in a more predictable syntax:
DELETE 10 DELETE 40-100
In ABasiC DELETE can also be used with a single line number to remove only one line. But, as the Microsoft BASICs, it also allows the use of an "-" prefix meaning every line up to the given one.
In BBC BASIC DELETE is always used for removing a range of lines, but the initial and the final line given as arguments are separated by a comma instead of an hyphen.
In FreeBASIC's -lang fb dialect, DELETE is an operator used to destroy an object or an array of objects created with NEW:
Type Rational As Integer numerator, denominator End Type Dim p As Rational Ptr = New Rational(3, 4) Delete p ' Set the pointer to null to guard against future accesses p = 0 Dim p As Integer Ptr = New Integer[100] For i As Integer = 0 To 99 p[i] = i Next Delete[] p
* https://documentation.help/FreeBASIC/KeyPgOpDelete.html , last check 2024-06-01