From Xojo Documentation
Returns (as an Integer) the line number in which the CharacterPosition character appears.
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.
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: