• Welcome to Jose's Read Only Forum 2023.
 

IDictionary.Remove Method

Started by José Roca, July 13, 2008, 10:10:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the Remove method

JScript


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


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


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