FindLastKey method (ILEADDicomDS)

VB.NET example

C# example

Visual Basic example

Visual C++ 6.0 example

 

Syntax

short FindLastKey (BSTR pszKey, BOOL bTree);

Overview

Refer to Working with Key Elements.

Remarks

Updates the CurrentElement property with the last element in the Data Set that has the specified key element type. The search begins with the element specified in the CurrentElement property. The results depend on whether the Data Set is evaluated as a tree or a list.

If the Data Set is evaluated as a tree structure, this method updates the CurrentElement property with the last item on the same level and with the same parent as the element specified in the CurrentElement property, that has key element type pszKey.

For the sake of these illustrations, the order of siblings is top to bottom. Therefore last is the item closest to the bottom.

Please note that the numbering of the items of interest in this first illustration is arbitrary and does not imply order.

image\FndFtTr.gif

 

If the CurrentElement property contains:

The CurrentElement property will be updated with:

Item 1

The last sibling (same level, same parent) of Item 1 that has key element type pszKey, if such an item exists. If such an item does not exist, the CurrentElement is updated with NULL.

Item 2

The last sibling (same level, same parent) of Item 2 that has key element type pszKey, if such an item exists. If such an item does not exist, the CurrentElement is updated with NULL.

Item 3

The last sibling (same level, same parent) of Item 3 that has key element type pszKey, if such an item exists. If such an item does not exist, the CurrentElement is updated with NULL.

 

If the Data Set is evaluated as a list, this method updates the CurrentElement with the last item in the entire list that has key element type pszKey. The search begins at the element specified in the CurrentElement property.

For the sake of these illustrations, the order of siblings is top to bottom. Therefore last is closest to the bottom.

Please note that the numbering of the items in this illustration does indicate the order of the items when the Data Set is evaluated as a list.

 

image\FndFtLst.gif

 

If the CurrentElement property contains:

The CurrentElement property is updated with :

Item 1 

The last item in the list that has key element type pszKey, if such an item exists. If an item with key element type pszKey is not found, the CurrentElement property is updated with NULL.

Item 14

The last item in the list that has key element type pszKey, if such an item exists If an item with key element type pszKey is not found, the CurrentElement property is updated with NULL.

Item 22

The last item in the list that has key element type pszKey, if such an item exists. If an item with key element type pszKey is not found, the CurrentElement property is updated with NULL.

 

The following methods will also help you find elements in the Data Set with a specific key element type:

FindFirstKey method

FindPrevKey method

FindNextKey method

See Also

Elements:

FindFirstKey method, FindPrevKey method, FindNextKey method

Topics:

Key Elements: Searching the DICOM Dir Data Set