Verifying membership of a key

This example verifies that a key is in the dictionary. A for loop iterates over 20 keys. For each key the return value from Member is tested for a value of NIL. A return value of NIL indicates the key is not in the dictionary.

      for (i = 1; i <= 20; i++) {
          TCollectibleLong key(i);
          TCollectibleLong *tmpKey;
          if ((tmpKey=(TCollectibleLong*)dict3->Member (key)) != NIL) {

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker