Delete Command

Purpose

deletes an element from a one-dimensional array of any variable type.

Syntax

Delete x(m)

m:integer expression

x():one-dimensional array of any variable type

Description

Delete x(m) deletes the element indexed by m from the array x(). In other words all array items whose indices are greater than or equal to m are shifted one position up. The last element in the array is deleted (with 0 or "" depending on type).

Example

OpenW # 1

Dim a$(4), i%

a$(1) = "Text 1"

a$(2) = "Text 2"

a$(3) = "Text 3"

a$(4) = "Text 4"

Delete a$(3)

For i% = 1 To 4

Print a$(i%)

Next i%

// prints

// Text 1

// Text 2

// Text 4

See Also

Insert

{Created by Sjouke Hamstra; Last updated: 30/09/2014 by James Gaite}