Skip to content

TOnIsDataEqual

Callback type to check whether 2 data types are equal.

Declaration

Source position: cachecls.pp line 60

type
  TOnIsDataEqual = function(ACache: TCache; AData1: Pointer; 
                          AData2: Pointer) : Boolean of object;

Arguments

Name Description
ACache TCache instance which calls the callback.
AData1 First data element pointer.
AData2 Second data element pointer.

Function result

True if AData1 and AData2 are equal.

Description

TOnIsDataEqual is a callback prototype; It is used by the TCache.Add call to determine whether the item to be added is a new item or not. The function returns True if the 2 data pointers AData1 and AData2 should be considered equal, or False when they are not.

For most purposes, comparing the pointers will be enough, but if the pointers are ansistrings, then the contents should be compared.

See also

Name Description
TCache.Add Add a data element to the list.