TextAreaCursor ( textarea[,units] )

Parameters

textarea - text area gadget

units (optional) - what the position counts:
1: characters (default)
2: lines

Description

Returns the cursor position in a text area, in characters or lines.

In character units this is the cursor's Unicode character position from the start of the text; in line units it is the line the cursor sits on (both counted from 0). When the user has a selection, the position reported is the start of the selection.

Together with TextAreaSelLen this describes the selection as a range you can feed to TextAreaText or FormatTextAreaText - and the line form drives the classic "Line 12" status-bar readout:

SetStatusText window,"Line "+(TextAreaCursor(area,2)+1)


See also: TextAreaSelLen, TextAreaLine, TextAreaChar, TextAreaText.

Index