The LineIndex method retrieves the one-based character index of the beginning of the line in the associated edit control.


The only argument is:


The number of the line of which the starting index is to be retrieved. Line numbers are incremented by 1, starting with 1.

Return value:

The character index of the specified line. The first line starts at index 1.


The following example sets the text for edit control TEXT and displays the number of text lines (3), the starting index of the second line (carriage return, 0x0d, and line feed, 0x0a, which mark a line break, are also considered to be characters), and the length of the third line:

editControl = MyDialog~GetEditControl("TEXT")
if .nil == editControl then return

text = "It is easy to learn and easy to use." || '0d0a'x || -
       "Have fun with it!"                    || '0d0a'x || -
       "But don't over do it."


say "Number of lines:" edit~lines
say "Line 2 begins at index" edit~LineIndex(2)
say "Length of 3rd line:" edit~LineLength(3)

Result: Number of lines: 3
        Line 2 begins at index 39
        Length of 3rd line: 21