FutureBasic Logo

<<    Index    >> FutureBasic 5

SetSelect   statement



Syntax:
SetSelect startSelect%,endSelect%

Description:
If the current output window contains an active edit field, this statement selects (highlights) a range of text in the field, or sets the position of the blinking insertion point. It also scrolls the selected text into view, if it's not already in view.
The startSelect% and endSelect% parameters refer to positions between characters in the field. Position 0 is just to the left of the first character; position 1 is between the first and second characters; and so on. If you specify a position greater than or equal to the number of characters in the field, it indicates a position just to the right of the last character. If startSelect% equals endSelect%, then no text is highlighted, but a blinking insertion point is paced at the indicated position.

Example:
If you specify SetSelect 0,0, a blinking insertion point is placed at the beginning of the field's text. If you specify SetSelect 0,32767, all of the text in the field is selected. If you specify SetSelect 32767,32767, a blinking insertion point is placed at the end of the field's text.
The following inserts or replaces the selected range with the contents of newString$:
SetSelect startSelect%, endSelect%
tekey$ = newString$


Note:
Text selection and insertion-pont placement are normally handled automatically by the HandleEvents statement, in response to the user's mouse and keyboard actions. Use SetSelect for special situations.
Use the window(_selStart) and window(_selEnd) functions to determine the active field's current selection range.

See Also:
edit field; tekey$ statement; window function