Reports the position of the insertion point in an editable control.
To report |
Use |
---|---|
The position of the insertion point in any editable control (except RichTextEdit) |
|
The position of the insertion point or the start and end of selected text in a RichTextEdit control or a DataWindow whose object has the RichTextEdit presentation style |
Determines the position of the insertion point in an edit control.
DataWindow, EditMask, MultiLineEdit, SingleLineEdit, or DropDownListBox, DropDownPictureListBox controls
editname.Position ( )
Argument |
Description |
---|---|
editname |
The name of the control in which you want to find the location of the insertion point |
Long. Returns the location of the insertion point in editname if it succeeds and -1 if an error occurs. If editname is null, Position returns null.
Position reports the position number of the character immediately following the insertion point. For example, Position returns 1 if the cursor is at the beginning of editname. If text is selected in editname, Position reports the number of the first character of the selected text.
In a DataWindow control, Position reports the insertion point’s position in the edit control over the current row and column.
If mle_EmpAddress contains Boston Street, the cursor is immediately after the n in Boston, and no text is selected, this statement returns 7:
mle_EmpAddress.Position()
If mle_EmpAddress contains Boston Street and Street is selected, this statement returns 8 (the position of the S in Street):
mle_EmpAddress.Position()
Determines the line and column position of the insertion point or the start and end of selected text in an RichTextEdit control.
RichTextEdit and DataWindow controls
rtename.Position ( fromline, fromchar {, toline, tochar } )
Band enumerated datatype. Returns the band (Detail!, Header!, or Footer!) containing the selection or insertion point.