version 6.0
DR GET HIGHLIGHT (area; first; last)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| first | Longint | Position of first character minus 1 | |
| last | Longint | Position of last character |
Description
The command DR GET HIGHLIGHT returns into the first and last variables the character positions of the highlighted text in area.
first is one less than the first character position highlighted, and last is the last character highlighted. If first equals last, no characters are highlighted, and the insertion point is between first and first +1.
As only one object at a time can have highlighted text, the scope parameter is not needed. If there is no highlighted text in area, DR GET HIGHLIGHT returns -32000 for first and last, and DR Error returns 56.
Example
The following example returns the position of the highlighted text and if no text is selected it alerts the user.
DR GET HIGHLIGHT (Area;$First;$Last)
If (DR Error=56)
ALERT ("There is no text highlighted.")
End if
See Also