Get or set the input position for a multi-line text field

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xcall I_TXTPOS(window_id, field_spec, D_LAST)
xcall I_TXTPOS(window_id, field_spec, [D_CHANGE,] row, column)
xcall I_TXTPOS(window_id, field_spec, D_GETNEXT|D_GETLAST, row, column)



The ID of the input window containing the field. (n)


The specification for the multi-line text field. (See Field specifications for information.) (a)


Sets the position for subsequent input to field_spec to the position the cursor last occupied when accepting input.


(optional) Specifies that the values passed in row and column are offsets relative to the last position occupied during input (if you pass D_CHANGE), or it specifies that row and column are absolute coordinates relative to the field origin if you omit D_CHANGE (i.e., if you pass row and column without a D_ option).


Returns in row and column the next projected position that will be used for input (or zeros if there is no projected next position).


Returns in row and column the last position occupied by the cursor to accept input (or zeros if there has been no previous input).


A row within the multi-line text field. (n)


A column within the multi-line text field. (n)


I_TXTPOS gets or sets the input position for a multi-line text field:

If either window_id or field_spec is invalid, a fatal error occurs.

Note the following when setting the position for subsequent input (D_LAST, D_NEXT, or no D_ option):

xcall i_txtpos(inpid, "mytext", 2, 1) 

If you use D_GETNEXT, and the field is not set to RETAIN_POSITION (.FIELD) or D_FLD_RETPOS (IB_FIELD or I_FLDMOD), row and column are returned as zero unless you have set them to something else (with I_TXTPOS). In that case, they’ll return the values they were set to, as long as input hasn’t occurred on the field since they were set.


This example sets the position for the next input of the text field mytext to be the same position as last occupied during input of this field:

xcall i_txtpos(inpid, "mytext", D_LAST)

This example moves the position within the text field down one row from the previous input position (if the text field is set to RETAIN_POSITION or D_FLD_RETPOS):

xcall i_txtpos(inpid, "mytext", D_CHANGE, 1, 0)

The next example moves the position to the beginning of the second row of the text field:

xcall i_txtpos(inpid, "mytext", 2, 1) 

The following examples retrieve the next projected input position and the last input position:

xcall i_txtpos(inpid, "mytext", D_GETNEXT, next_row, next_col)

xcall i_txtpos(inpid, "mytext", D_GETLAST, last_row, last_col)