Skip to main content

Append

procedure Append(S: string);

Example​

procedure AppendStatus(const Items: TStringList);
begin
Items.Append('Complete');
end;

Usage​

Append adds one string by calling Add and discarding the returned index.

  • Prefer Add when subsequent logic needs the actual index.
  • Do not use Append to bypass sorting or duplicate policy.
  • The call mutates the list and may invoke change events.

Additional Technical Info​

Append is declared by hidden ancestor TStrings and is normally used through a concrete visible descendant such as TStringList. Despite its name, a sorted concrete list can place the value somewhere other than the physical end.

Source-backed behaviour​

The installed RTL implementation consists solely of Add(S). Virtual dispatch therefore preserves the concrete descendant's sorting, duplicate, comparison, allocation and event behaviour.

No index is returned. On an unsorted TStringList it behaves like an append; on a sorted one it behaves like sorted insertion, and duplicate policy may ignore or reject the value.

Add is the exact terminal call. AddObject adds an association, and Strings provides indexed access.

Official RTL references​

Created 2026-07-15