Sign in Join
FPDoc Onlineexperiment

TTextStrings class

In unit TextStrings

Implements a string list optimized to handle the complete text as a whole (instead of line by line as in TStringList).

Declaration

pascal
TTextStrings = class(TCustomMemoStrings)

Inheritance

  1. TTextStrings
  2. TCustomMemoStrings
  3. TStrings

Description

TTextStrings is a TCustomMemoStrings descendant which implements a string list optimized for handling the complete text in the list (rather than on a line by line basis).

The ancestor class ensures that lines of text with wordwrap line endings are handled in the component. TTextString uses an internal array of TTextLineRange instances to represent the lines of text. Overridden methods are provided to ensure that the internal line ranges are used to implement property values.

TTextStrings is the type instantiated for use in the Lines property in TCustomMemo.

See also

Properties

TextpublicContains the textual representation for the values in Strings.

Methods

GetTextStrprotectedGets the value for the Text property.
SetTextStrprotectedSets the value for the Text property.
BuildArraysprotectedClears and builds the array with the line ranges for the values in Text.
GetCountprotectedGets the value for the Count property.
ChangedprotectedPerforms actions needed after the value in Text is changed.
ChangingprotectedPerforms action needed when properties in the component are being updated.
GetprotectedGets the value for the indexed Strings property.
ClearArraysprotectedClears the internal array of line ranges used in the component.
GetObjectprotectedGets the value for the indexed Objects property.
PutprotectedSets the value for the indexed Strings property.
PutObjectprotectedSets a value in the indexed Objects property.
GetLineLenprotectedGets the length of a line (including optional end-of-line characters) at the specified position.
GetLineEndprotectedGets the ordinal position where the specified line ends in the Text property.
CountLineEndingsprotectedGets the number of end-of-line sequences found in the specified string.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
ClearpublicClears the text and internal line ranges for the component.
SetTextpublicSets the value for the Text property from a PChar type.
InsertpublicInserts the line of text in S at the specified position.
DeletepublicDeletes the line of text at the specified position.
ExchangepublicSwaps the line values at the specified positions.
MovepublicMoves a String value from the current position to the new position.
MakeTextBufferUniquepublicEnsures that the reference count for the Text member is 1.
BeginUpdatepublicStarts an update process for the component.
EndUpdatepublicFinishes an update process for the component.
GetTextpublicGets the value for the Text property as a PChar type.
IndexOfpublicGets the ordinal position for the specified String value.
AddpublicAppends the specified text to the values in Strings.
AddObjectpublicAdds a String and Object pair to the string list.
AddStringspublicAdds the lines of text in TheStrings to the current class instance.
LoadFromFilepublicLoads the content in the string list from the specified file name.
SaveToFilepublicSaves the content in the string list to the specified file name.

Events

OnChangepublicEvent handler signalled when values in Strings or Objects have been changed.
OnChangingpublicEvent handler signalled before properties are updated in the component.

Fields

FArraysValidprotectedBoolean flag which indicates whether the array of line ranges is valid.
FLineCountprotectedNumber of lines in the array of line ranges.
FLineCapacityprotectedNumber of line ranges allocated for the component.
FLineRangesprotectedPointer to an array of TTextLineRange instances used for the Strings in the component.
FTextprotectedMember variable used to store the Text in the component.
FUpdateCountprotectedNumber of times BeginUpdate has been called without a corresponding EndUpdate.
FChangedWhileUpdateprotectedIndicates if Changed was called after calling BeginUpdate.

Inherited

From TCustomMemoStrings (3)

DefineProperties DoReadData DoWriteData

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.