Definition
The mouse cursor is used to easily view the location where the action will be performed. For a control in edit, the cursor turns into a blinking vertical line, allowing you to easily identify the location of the next character typed.
If a selection is performed in the control, the selected characters are displayed in "reverse video". The position of the cursor corresponds to the beginning of the area displayed in "reverse video".
Some examples:
| |
| The input cursor is located at the beginning of the input area. Its position is 1. |
| The input cursor is located at the end of the input area. Its position is 7 in this example. |
| The input cursor is located at the beginning of the area in "reverse video" (position 3 in this example). ..CursorEnd is used to find out and modify the end of the selected area. |
// -- Click code of BTN_Selection button (Interrupt button)
// Select the entire text
EDT_Edit1..Cursor = 1
EDT_Edit1..CursorEnd = Length(EDT_Edit1) + 1
// Deselect the text
EDT_Edit1..CursorEnd = EDT_Edit1..Cursor
Syntax
Finding out the position of the last selected character Hide the details
<Position> = <Control name>..CursorEnd
<Position>: Integer
Position of last selected character + 1. ..Cursor and ..CursorEnd are equivalent if no character is selected. If the control is not in edit, the position is 0.
<Control name>: Character string (with or without quotes)
Name of the control in which a selection was performed.
Selecting a set of characters Hide the details
<Control name>..CursorEnd = <Number of selected characters>
<Control name>: Character string (with or without quotes)
Name of the control in which a selection must be performed.
<Number of selected characters>: Integer
The selected string is included between the position of the cursor and the value sent to ..CursorEnd.
The smallest possible value is 1 (cursor on the left). The greatest value corresponds to the number of characters found in the control + 1.
Caution: If ..CursorEnd is assigned with its own content, the text is deselected: no character is displayed in reverse video.
Remarks
Limit: Selection in reverse video
The selection in reverse video is available only if the control is being edited. ..CursorEnd returns 0 if the control is not currently in edit mode.