SelStart - DfBaseForm
Returns beginning position 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. So, 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 oForm1 and then displays the selection range (or length) 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