Skip to content

SelEnd - DfBaseForm

Returns end of selection

Type: Function
Return Data Type: Integer

Syntax

Function SelEnd Returns Integer

Call Example

Get SelEnd to IntegerVariable

Description

Returns ending position of selection.

Returns the last character position inside the selection. If no text is selected, returns the current position of the caret.

The character position is the zero-based absolute position of the character in the control. The first position in the first line is always 0. If the first line in the control contains 20 characters, and the selected text is characters 5 through 10 of the second line, the return value of SelEnd will be 30.

Sample

This sample gets the beginning and ending position of the selected text of control oForm1 and then displays the range to the user in a message box.

Procedure ShowSelectionRange
    Integer iSelStart iSelEnd

    Get SelStart of oForm1 to iSelStart
    Get SelEnd of oForm1 to iSelEnd

    Send Info_Box (string(iSelStart) + " to " + string(iSelEnd)) "Range of selected text"
End_Procedure

See Also

SelStart | SetSel