Sign in Join
FPDoc Onlineexperiment

TLookupStringList.InsertItem procedure

Member of TLookupStringListprotectedIn unit LookupStringList

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

Declaration

pascal
procedure 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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.