JVCL Help:TJvCustomRichEdit.GetLineLength

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Retrieves the length, in characters, of a specific line.


Pascal

 functionGetLineLength(CharIndex: Integer): Integer;


Parameters

Parameters Description
CharIndex: Integer Specifies the character index of a character in the line whose length is to be retrieved. This parameter can be –1. In this case, GetLineLength returns the number of unselected characters on lines containing selected characters.


Return Value

Returns the length, in characters, of the line specified by the CharIndex parameter. It does not include the carriage-return character at the end of the line. If CharIndex is greater than the number of characters in the control, the return value is zero.


Description

Call GetLineLength to retrieve the length, in characters, of a line in the rich edit control. Alternatively, call GetLineIndex to retrieve a character index for a given line number.
If you set parameter CharIndex to -1, GetLineLength returns the number of unselected characters on lines containing selected characters. For example, if the selection extended from the fourth character of one line through the eighth character from the end of the next line, the return value would be 10 (three characters on the first line and seven on the next).
Retrieve the length of the current line: LengthCurrentLine := JvRichEdit1.GetLineLength(JvRichEdit1.GetLineIndex(-1));


See Also

TJvCustomRichEdit.GetLineIndex


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page