TPlusMemo.Lines, Paragraphs properties
PlusMemo Help Send comments on this topic.
TPlusMemo.Lines, Paragraphs properties

Glossary Item Box

 

Applies to

TPlusMemo, TDBPlusMemo

 

Declaration

property Lines: TStrings;

property Paragraphs: TStrings;

 

Description

These properties are used to work with the text content of a TPlusMemo or TDBPlusMemo by using a TStrings programming interface.  All the interface elements of TStrings are supported by Lines and Paragraphs, particularly properties CountStrings, Text, and methods Assign, LoadFromFile, SaveToFile, BeginUpdate and EndUpdate.

 

So, both Lines and Paragraphs have the same properties and methods.  The former is used to work with individual lines of text, while the latter pertains to reading or modifying complete paragraphs.  When a TPlusMemo is operated with WordWrap equal to false, lines and paragraphs are the same but property Paragraphs offers a slightly more efficient access.  With WordWrap set to True, paragraphs are formatted into lines that fit the width of the control.  In this case, Paragraphs and Lines may have definitely different behavior.

 

Property Lines is made available at design time so that existing applications based on TMemo will incur minimum change to convert to TPlusMemo.  An improved custom TStrings property editor is provided in the PlusMemo package.

 

For compatibility with TMemo, Lines.Count and Paragraphs.Count do not take account of the last line or paragraph when it is empty.  Properties LineCount and ParagraphCount are provided to get the total number of lines or paragraphs, including the last one even if empty.