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

TTextStrings.Delete

Deletes the line of text at the specified position.

Declaration

Source position: textstrings.pas line 84

public procedure TTextStrings.Delete(

  Index: Integer

); override;

Arguments

Index

  

Ordinal position for the value removed from the Strings property.

Description

Delete is an overridden method used to delete the line of text at the specified position. BuildArrays is called to populate the internal array of TTextLineRange instances when the internal validity flag is not set.

Index contains the ordinal position in Strings for the line of text removed in the method. Index must be in the range 0..Count-1 or an EStringListError exception is raised.

Line range information is used to adjust both Text and the internal array of TTextLineRange instance. The line, including end-of-line characters, is removed from Text. The line counter is decremented, and the array of line ranges is updated. Line ranges after Index are updated to move their start and end positions downward by the length of the removed line. The memory at the end of the line ranges is zero-filled to prevent corruption.

Errors

Raises an EStringListError exception when Index is not a valid position in the list of string values.

See also

TTextStrings.BuildArrays

  

Clears and builds the array with the line ranges for the values in Text.

TTextStrings.Text

  

Contains the textual representation for the values in Strings.

TTextLineRange

  

TTextLineRange - record structure showing start and end of line in text, the line as a string, and any user data.

EStringListError

TStrings.Count

TStrings.Delete

TStrings.Strings


Version 4.0 Generated 2025-05-03 Home