Author Topic: IDictionary.Remove Method  (Read 3048 times)

0 Members and 1 Guest are viewing this topic.

Online José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
  • User-Rate: +209/-0
  • Gender: Male
IDictionary.Remove Method
« on: July 13, 2008, 10:10:25 PM »

The following example illustrates the use of the Remove method

JScript

Code: [Select]
var d;
d = new ActiveXObject("Scripting.Dictionary"); 
d.Add ("a", "Athens");       // Add some keys and items.
d.Add ("b", "Belgrade");
d.Add ("c", "Cairo");
...
d.Remove("b");               // Remove second pair.

VBScript

Code: [Select]
Dim d
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens"   ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
...
d.Remove("b")   ' Remove second pair.

PowerBASIC

Code: [Select]
DIM d AS IDictionary
DIM vKey AS VARIANT
DIM vItem AS VARIANT

d = NEWCOM "Scripting.Dictionary"
vKey = "a" : vItem = "Athens"
d.Add vKey, vItem
vKey = "b" : vItem = "Belgrade"
d.Add vKey, vItem
vKey = "c" : vItem = "Cairo"
d.Add vKey, vItem
...
vKey = "b"
d.Remove vKey
« Last Edit: July 13, 2008, 10:58:36 PM by José Roca »