====== DELETE ======
/* Remove the comments after creating content for each section.*/
Removes a file from disk; or lines from a program; or an object from memory
/*
For the lines below, just create links, separated by commas, to other pages of the BASICs section,
like [[:basics:basicTagName]].
"Implemented by" should mention BASICs which implement the keyword like described, in a more usual and standard way.
"With variations" should point to BASICs where this keyword is used a bit differently.
"Also written as" should list alternative spellings and abbreviations this keyword has. No need to
refer to a BASIC, there is a section for that later.
*/
**Implemented by:** [[:basics:ANSI:ansifull]], [[:basics:decbasic:]], [[:basics:Altair:altair12K]], [[:basics:Applesoft:]], [[:basics:TI994:]], [[:basics:CBM:cbmv7]], [[:basics:CBM:cbmv3.5]], [[:basics:trs80:level2]], [[:basics:BBC:]], [[:basics:bwbasic:bw32]], [[:basics:ABasiC:]]
**With variations:** [[:basics:hptsb:]], [[:basics:VBDOS:]] (ISAM instruction), [[:basics:bwbasic:]], [[:basics:MSX:]], [[:basics:GWBASIC:]] (program edition), [[:basics:FreeBASIC:]] (destroy an object)
**Also written as: **
===== Usage =====
/* For inline examples of syntax, write the keyword between '' and '' (two single quotes) */
[[:basics:ANSI:ansifull|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.
==== Variations ====
[[:basics:GWBASIC:]] and [[:basics:MSX:|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 [[:basics:bwbasic:|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 [[:basics: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 [[:basics:BBC|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 [[:basics:FreeBASIC:|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
===== Comments =====
/* Origin of the keyword, opinions, history... */
===== Related keywords =====
/* Keywords that are often or always used along this one */
===== Similar keywords =====
/* Keywords with the same or similar functionality found in other versions of BASIC */
* [[DEL]]
* [[ERASE]]
===== In other languages... =====
/* For parallels and comparisons with other modern-day languages */
===== References =====
/* If you used the ((citation)) syntax elsewhere in the text, they will appear under this section. But you can write some recommendations of books, magazines, etc */
* https://documentation.help/FreeBASIC/KeyPgOpDelete.html , last check 2024-06-01
/*
===== TAGS =====
Please use the syntax below for adding tags to this page, separated by spaces (use quotes for tags with spaces).
The most important tags to be used are, separated by groups:
- Statements | Commands | SpecialVariables | Operators
{{tag>tagName}}
*/
{{tag>Commands Statements Files Edition}}