DR SET HIGHLIGHT

4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next

version 6.0


DR SET HIGHLIGHT (area; scope; first; last)

ParameterTypeDescription
areaLongint4D Draw area
scopeLongint-1 = All, 0 = Selected, >0 = Object ID
firstIntegerPosition of first character -1
lastIntegerPosition of last character

Description

The command DR SET HIGHLIGHT highlights characters within the text object in area described by scope.

If scope equals -1, the command highlights characters in the first object of the document.

If scope equals 0, the command highlights characters in the first selected object.

If scope is greater than 0, it must be equal to a specific text object's ID and characters within that text object are highlighted. If the object does not exist, DR SET HIGHLIGHT does nothing, and DR Error returns error number 2. DR SET HIGHLIGHT causes the object described by scope to become the only object selected in area.

If the object described by scope is not a text object, DR SET HIGHLIGHT does nothing, and DR Error returns error number 47.

first and last determine which characters are highlighted. first is one less than the first character position to be highlighted. last is the last character position to be highlighted. If first equals last, no characters are selected and the insertion point is between first and first +1. If last is greater than the number of characters in the text object, then DR SET HIGHLIGHT highlights characters to the end of the text object.

DR SET HIGHLIGHT does not highlight only part of a reference. If any portion of a reference is highlighted, DR SET HIGHLIGHT adjusts the highlight to include the entire reference.

DR SET HIGHLIGHT is valid only when Area is being viewed at 100 percent (actual size). If the drawing is displayed at a different magnification, DR SET HIGHLIGHT does nothing, and DR Error returns error number 48.

Example

The following example gets the text of the selected text object and looks for the name "4th Dimension". If 4th Dimension is found, it highlights it and then makes it bold.

   $Temp := DR Get text (Area;0)
   $Find := Position ("4th Dimension";$Temp)
   If ($Find # 0)
      DR SET HIGHLIGHT (Area;0;$Find - 1;$Find + 12)
      DR SET TEXT ATTRIBUTES (Area;-3;-1;-1;1;-1;-1;-1)
   End if

See Also

DR Get text, DR GET TEXT ATTRIBUTES, DR SET TEXT, DR SET TEXT ATTRIBUTES.


4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next