version 3
GET HIGHLIGHT (area; startSel; endSel)
Parameter | Type | Description | |
area | Field | Variable | Enterable field or variable | |
startSel | Number | Current text selection starting position | |
endSel | Number | Current text selection ending position |
Description
The GET HIGHLIGHT command is used to determine what text is currently highlighted.
Warning: Although you pass a enterable field or variable name to GET HIGHLIGHT, this command returns a significant selection position only when it is applied to the area currently being edited.
Note: This command cannot be used with fields in the List form of a subform.
Text can be highlighted by the user or by the HIGHLIGHT TEXT command.
The parameter startSel returns the position of the first highlighted character.
The parameter endSel returns the position of the last highlighted character plus one.
If startSel and endSel are returned equal, the insertion point is positioned before the character specified by startSel. The user has not selected any text, and no characters are highlighted.
Examples
1. The following example gets the highlighted selection from the field called [Products]Comments:
GET HIGHLIGHT ([Products]Comments;vFirst;vLast) If (vFirst<vLast) ALERT("The selected text is: "+Substring([Products]Comments;vFirst;vLast-vFirst)) End if
2. See example for the command FILTER KEYSTROKE.
See Also
FILTER KEYSTROKE, HIGHLIGHT TEXT, Keystroke.