company logo

Property :: last - Try selecting last instance in a collection

The function tries to locate the last instance in a property handle (collection). Calling last() for an attribute property will work but without any effect. For attribute arrays it will position the property handle to the last array element.

When a filter has been defined for the collection, the function tries to locate the last valid instance according to the filter condition.

Usually, the instance will be located and positioned. To avoid reading instance for optimization, the function can be called with the parameter false. In case of instance filters or unordered collections, however, instances might be positioned.

The function returns true, when the last instance has been located successfully. Otherwise it returns false. In case of read errors or when the property handle is not accessible, the function throws an exception.

Return value:  Success ( bool  )

The value is true when the function was executed successfully. Otherwise the value is set to false.

Implementation overview

Implementation details

  1. Locate last instance
    bool Property  :: last (  )

    The function positions the last instance in the property handle without reading it. The instance might be selected when a filter has been set for the property handle.

    In order to make sure that the instance is selected, one may call get() or last(true).

  2. to list
  3. Locate and read last instance
    bool Property  :: last ( bool bRead )

    The function locates and reads the last instance, when passing true in bRead. When passing false, the function tries to locate the instance without reading.

    • bRead - Read option

      The option forces the function to read the instance when it could be located.

  4. to list