Skip to content

SelStart - DfBaseRichEdit

Returns beginning of selection

Type: Function
Return Data Type: integer

Syntax

Function SelStart Returns integer

Call Example

Get SelStart to integerVariable

Description

Returns beginning position of selection.

Returns the first 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 SelStart will be 25.

Sample

This sample gets the beginning and ending position of the selected text of control oRichEdit1 and then displays the selection range (or length) to the user in a message box.

Procedure ShowSelectionRange
    Integer iSelStart iSelEnd

    Get SelStart of oRichEdit1 to iSelStart
    Get SelEnd of oRichEdit1 to iSelEnd

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

See Also

SelEnd | SelText

Return Value

Beginning position of selection.