Remove Method

 

Description

 

Removes a key, item pair from a Dictionary object.

 

PowerBASIC Syntax

 

METHOD Remove ( _

BYREF vKey AS VARIANT _

)

 

Arguments

 

vKey

Key associated with the key, item pair you want to remove from the Dictionary object.

 

Remarks

 

An error occurs if the specified key, item pair does not exist.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM pDic AS IDictionary

DIM vKey AS VARIANT

DIM vItem AS VARIANT

 

' Create an instance of the Dictionaty object

pDic = NEWCOM "Scripting.Dictionary"

' Add some key/item pairs to the dictionary

vKey = "a" : vItem = "Athens"

pDic.Add vKey, vItem

vKey = "b" : vItem = "Belgrade"

pDic.Add vKey, vItem

vKey = "c" : vItem = "Cairo"

pDic.Add vKey, vItem

' Remove second pair

vKey = "b"

pDic.Remove vKey

 

Valid XHTML 1.0 Transitional