Sign in Join
FPDoc Onlineexperiment

TStringHashList.Remove function

Member of TStringHashListpublicIn unit StringHashList

Frees resources allocated for the hash item and deletes it from the List.

Declaration

pascal
function Remove(const S: string): Integer
function Remove(const S: string; Data: Pointer): Integer

Description

Remove is a method used to remove a hash item in List with the specified key value (and optional data).

S contains the key value to locate in the List.

Data is an untyped Pointer to the optional data associated with the key value.

Remove calls the Find method to get the ordinal position in List where the hash item is stored, or -1 when a hash item with the key (and optional data) is not found. The position is used as the return value for the method.

When a hash item was located, the Dispose routine is called to free the memory allocated for the typed Pointer to the hash item. Delete is called to remove the PHashStringItem instance and re-order the memory for hash items after the position in List. The Count property is decremented to reflect the new size for the List.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.