[Overview][Types][Classes][Index] Reference for unit 'StringHashList' (#lazutils)

TStringHashList.Remove

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

Declaration

Source position: stringhashlist.pas line 65

public function TStringHashList.Remove(

  const S: string

):Integer;

function TStringHashList.Remove(

  const S: string;

  Data: Pointer

):Integer;

Arguments

S

  

Key value for the hash item removed in the method.

Function result

Ordinal position in List for the removed hash item, or -1 when not found.

Arguments

S

  

Key value for the hash item removed in the method.

Data

  

Untyped pointer to the optional data for the hash item.

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.


Version 4.0 Generated 2025-05-03 Home