[Overview][Classes][Procedures and functions][Index] Reference for unit 'LookupStringList' (#lazutils)

TLookupStringList.InsertItem

Adds a new value to the items and the string map with duplicate enforcement.

Declaration

Source position: lookupstringlist.pas line 42

protected procedure TLookupStringList.InsertItem(

  Index: Integer;

  const S: string

); override;

Arguments

Index

  

Position for the new item.

S

  

Value for the new item.

Description

InsertItem is an overridden method which ensures that the internal String map and the Duplicates property are used when an item value is inserted. When Sorted contains False, the value in Duplicates determines the actions taken.

dupAccept
Duplicates are allowed. Inserts the item and adds it to the string map.
dupIgnore
Ignores duplicates. No actions are performed when S is already in the string map.
dupError
Raises an Exception if S is already in the string map.

InsertItem calls the inherited method, and adds the value in S to the internal string map.

Errors

Raises an Exception when adding a duplicated value and Duplicates contains dupError. Raised with the message 'TLookupStringList.InsertItem: Duplicates are not allowed.'

See also

TStringList


Version 4.0 Generated 2025-05-03 Home