TXTextControl.CurrentInputPosition Property

Returns or sets an array of three values which specify the page, line and column number of the current text input position. These values are the same as shown in Text Control's status bar.

Syntax

TXTextControl.CurrentInputPosition [= Array]
Index Description
0

Specifies the current page number. The first page has the number one.

1

Specifies the current line number. The first line has the number one.

2

Specifies the current column number. The first column has the number one.

Data Types

Array of 3 Long.

Limitations

Run time only.

Example

The following code snippet demonstrates how to use the CurrentInputPosition property to get the current position of the caret in the document and afterwards set its position to the very beginning of the text.

 ' Get current position
  cur = TXTextControl1.CurrentInputPosition
  deb = Str(cur(0)) + "-" + Str(cur(1)) + "-" + Str(cur(2))
  MsgBox deb
  ' Set new position
  cur(0) = 1 ' page
  cur(1) = 1 ' line
  cur(2) = 0 ' col
  TXTextControl1.CurrentInputPosition = cur

See Also