Retrieving a value
from the dictionary
Retrieving a value from a disk dictionary has different internal steps than those of adding a value. As you can see in Figure 28, the sequence of events is different from those in Figure 28 which shows how items are added to sets and dictionaries.
The following actions occur when you retrieve a value from a dictionary:
- Your program uses the key to query the disk dictionary.
- The dictionary passes the key to the index manager.
- The index manager associates the key with a record handle and passes the record handle back to the dictionary.
- The dictionary passes the record handle to the record manager. The record manager retrieves the value and passes it back to the dictionary.
- The dictionary passes the value back to your program.
This example retrieves a value from the disk dictionary and puts it into a variable of type TCollectibleLong. Then the value of the key and the dictionary value are printed.
TCollectibleLong *val = (TCollectibleLong *)dict3->Retrieve (key);
qprintf("The value retrieved for key \"%d\" = %d\n", key.GetValue(), val->GetValue());
[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