COLLECTION.DELETE Function

Syntax

V Delete(A key)

<COLLECTION>.DELETE( Key as C )

<COLLECTION>.DELETE( Key as D )

<COLLECTION>.DELETE( Key as N )

Arguments

key

A value (character, numeric or date) that uniquely identifies an element in a collection.

Description

Delete element from collection.

Discussion

The <COLLECTION>.DELETE() method deletes the collection element referenced by Key.

The following code in the Interactive window defines a collection and then deletes the entry for "BB".

dim mycollection as u
mycollection.SET("FJ","Fred Jones")
mycollection.SET("BB","Bryan Boyd")
mycollection.SET("KL","Kim Lee")
mycollection.SET("KB","Karen Boyd")
mycollection.SET("EL","Erica Loyd")
x = mycollection.enum_all()
'list the contents of x
? x
= "FJ
BB
KL
KB
EL
"
Mycollection.delete("BB")
x = mycollection.enum_all()
'list the contests of x
? x
= "FJ
KL
KB
EL
"

See Also