getCurrentKeys

getCurrentKeys(keys: ParamListType output);

The getCurrentKeys method of the MergeIterator class retrieves one or more keys at the current iterator position in the merged view.

This method can be used to access the keys of an external key dictionary or to access key properties in a member key dictionary from the iterator without having to access the member object itself.

The method can be called with a partial key list; for example, when iterating dictionaries with three keys, you can pass one, two, or three parameters to receive the output. The parameters must be of the same type as the keys or of type Any. If the parameter types do not match the key types or are not of type Any, a runtime exception is raised.

The following example shows the use of the getCurrentKeys method.

demoGetKeys(pIter: MergeIterator): Integer;
vars
    iter : Iterator;
    cust : Customer;
    name, address : String;  // variables to receive dictionary key values
begin
    while pIter.next(cust) do
        // retrieve the first key
        iter.getCurrentKeys(name);
        // retrieve the first two keys
        iter.getCurrentKeys(name, city);
    endwhile;
end;

When you use the getCurrentKeys method for filtering based on key conditions or populating list views with key data, judicious use of this method may result in performance improvements. (Performance improvements occur when you can avoid fetching objects from the server to access key properties.)