4D v16.3

HIGHLIGHT TEXT

Home

 
4D v16.3
HIGHLIGHT TEXT

HIGHLIGHT TEXT 


 

HIGHLIGHT TEXT ( {* ;} object ; startSel ; endSel ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a field or variable
object  Field, Variable, Form object in Object name (if * is specified) or Enterable field or variable (if * is omitted)
startSel  Longint in New text selection starting position
endSel  Longint in New text selection ending position

The HIGHLIGHT TEXT command highlights a section of the text in object.

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass the * parameter, you indicate that the object parameter is a field or variable. In this case, you pass the field or variable reference (form fields or variables only) instead of a string.

If object is not the object currently being edited, it gets the focus.

Note: This command cannot be used with fields in a subform.

startSel is the first character position to be highlighted, and lastSel is the last character plus one to be highlighted. If startSel and lastSel are equal, the insertion point is positioned before the character specified by startSel, and no characters are highlighted.

If lastSel is greater than the number of characters in object, then all characters between startSel and the end of the text are highlighted.

The following example selects all the characters of the enterable field [Products]Comments:

 HIGHLIGHT TEXT([Products]Comments;1;Length([Products]Comments)+1)

The following example moves the insertion point to the beginning of the enterable field [Products]Comments:

 HIGHLIGHT TEXT([Products]Comments;1;1)

The following example moves the insertion point to the end of the enterable field [Products]Comments:

 $vLen:=Length([Products]Comments)+1
 HIGHLIGHT TEXT([Products]Comments;$vLen;$vLen)

See example for the FILTER KEYSTROKE command.



See also 

GET HIGHLIGHT

 
PROPERTIES 

Product: 4D
Theme: Entry Control
Number: 210

 
HISTORY 

Created: < 4D v6
Modified: 4D v12

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)