LOCAL lnCursorPos, lnChars LOCAL lnLines, laLines[1], i, lcLine, lnLineLength lnCursorPos = this.selstart lnChars = 0 lnLines = ALINES(laLines,This.Text) FOR i = 1 to lnLines lcLine = laLines[i] * MESSAGEBOX(lcline) lnLineLength = LEN(lcLine) lnChars = lnChars + lnLineLength * MESSAGEBOX(lnLineLength) IF lnCursorPos * MESSAGEBOX("Cursor is positioned on line " + ALLTRIM(STR(i))) EXIT ENDIF ENDFOR RETURN i && line number