You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Sorted Array Collection - Compare Event
Compare is triggered when two key components need to be compared
Member of Sorted Array Collection (PRIM_SACO)

Parameters

Name

Type

Data Type

Description

Object

*Input

PRIM_OBJT

Object is the component being compared to

Subject

*Input

PRIM_OBJT

Subject is the component being compared

Result

*Both

Enumeration

Result is the result of the comparison

Details


The Compare event is fired whenever the collection needs to compare two components to determine their relative position.
The Subject and Object parameters contain the two instances to assess. A result of Greater, Less or Equal must be returned.
If the event is not coded, the collection will compare the two. This effectively uses the memory address of the two collection items.

Example


This example shows the comparison of two customer objects using the Surname property to define the sort order.
This example uses the Compare intrinsic to simplify the code.
Evtroutine Handling(#Customers.Compare) Subject(#Subject) Object(#Object) Result(#Result)
#Result := #Subject.Surname.Compare(#Object.Surname)
Endroutine

See also

All Component Classes
Technical Reference

  • No labels