TextEdit.LineNumber
From Xojo Documentation
Method
TextEdit.LineNumber(CharacterPosition as Integer) As Integer
New in 2019r2
Supported for all project types and targets.
New in 2019r2
Supported for all project types and targets.
Returns (as an Integer) the line number in which the CharacterPosition character appears.
Notes
Characters are numbered consecutively with the first character numbered 1. The first line is numbered zero. Used with ScrollPosition, this lets you scroll the control to a particular place in the text.
The line number reflects line breaks from both hard line breaks in the text and soft line breaks caused by word-wrapping within the control.
Example
Gets the line number for the character at position 100:
This example searches a TextArea using text provided in a TextField and then scrolls to the text in the TextArea: