CalculateHash calculates a hash value
Member of Collection (PRIM_COLL)
|Result||*Result (Optional)||Integer||Resulting number|
|Value||*Input||Variant||Value to hash|
Use the CalculateHash method to calculate a hash value. Hash values are used by the collection in order to obtain a hash that will always identify a component. Using the hash, only those components in the collection with the same hash are checked for equality. The default hash is the pointer to the component. There may be situations where you want to be able to look up in dictionary based on a value like a name or identifier. To obtain a hash for these kinds of values use the CalculateHash method during the Hash event supplying the value(s) that you want hashed Note that a hash event is only used by unordered collections (Set and Dictionary) that need to be able to do lookups quickly when there could be a large number of items in the collection. Other collections do lookups using the Compare event as a means to sort the items. Ordered collections do lookups by searching through the collection looking for a match. These collections use the IsEqual event and include the List and Array collection classes.
Using the CalculateHash method. The Hash event is fired whenever the collection needs to evaluate a hash.
Evtroutine Handling(#Collection.Hash) Subject(#Subject) Hash(#Hash) #Hash := #Collection.CalculateHash(#Subject) Endroutine
LANSA Version 15, April 2020