Author Topic: IDictionary.RemoveAll Method  (Read 3241 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

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

The following example illustrates the use of the RemoveAll method

JScript

Code: [Select]
var a, d, i, s;              // Create some variables.
d = new ActiveXObject("Scripting.Dictionary"); 
d.Add ("a", "Athens");       // Add some keys and items.
d.Add ("b", "Belgrade");
d.Add ("c", "Cairo");
...
d.RemoveAll( );       // Clear the dictionary.

VBScript

Code: [Select]
Dim d   ' Create some variables.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens"   ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
...
d.RemoveAll   ' Clear the dictionary.

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
...
d.RemoveAll   ' Clear the dictionary.
« Last Edit: July 13, 2008, 10:58:56 PM by José Roca »