Command WR SELECT

4D Write

WR SELECT

version 6.7 (Modified)


WR SELECT (area; type; begin{; end})

ParameterTypeDescription
areaLongint4D Write area
typeIntegerType to select
beginLongintFirst character
endLongintLast character. Optional for certain values of type

Description

The WR SELECT command selects text defined by type, begin, and end. WR SELECT does not change the current selection if the value searched for does not exist.

Set the type parameter using one of the following constants, found in the "WR Select type" theme:

Constantes (valeur)Description
wr select characters (0)Selects the characters located between begin and end. In this case, this is
the same as using WR SET SELECTION.
wr select expression (1)Selects the reference whose rank in the document is defined by begin.
end must be omitted.
wr select paragraphs (2)Selects the paragraphs located between begin and end.
wr select ruler(3)Selects the paragraphs that use the Xth ruler (whose rank in the
document starts at the beginning of the text). end must be omitted.
wr select picture(4)Selects the picture whose rank in the document is defined by begin. end
must be omitted.
wr select style (5)Selects the words that use the Xth style (whose rank in the document
starts at the beginning of the text). end must be omitted.
wr select word(6)Selects the word in which the insertion point is located.
wr select page break (7)Selects the page breaks whose rank in the document is defined by
begin. end must be omitted.
wr select column break (8)Selects the column breaks whose rank in the document is defined by
begin. end must be omitted.
wr select hyphen (9)Selects the hyphen whose rank in the document is defined by begin. end
must be omitted.
wr select page number (10) Selects the page number whose rank in the document is defined by
begin. end must be omitted. The selection only carries over to page
numbers inserted into the body of text.
wr select date and time (11)Selects the date and time variable whose rank in the document is
defined by begin. end must be omitted. The selection only carries over
to the dates or times automatically updated and inserted into the
body of text.
wr select hyperlink (12)Selects the hyperlink whose rank in the document is defined by begin.
end must be omitted.
wr select HTML expression (13)Selects the HTML expression whose rank in the document is defined
by begin. end must be omitted.
wr select RTF expression (14)Selects the RTF expression whose rank in the document is defined by
begin. end must be omitted.

Examples

1. The following example executes different functions based on the presence or the absence of a Page break:

      `Setting the selection
   WR SET SELECTION (area;0;0)
      `Try to select the first page break
   WR SELECT (area;wr select page break;1)
      `Retrieving the limits of the new selection
   WR GET SELECTION (area;$vlbegin;$vlend)
   If (($vlbegin=0) & ($vlend=0))
         `There is no page break
   Else
         `Do something with the page break
   End if

2. The following example selects the references in the 4D Write area referenced by area and applies to them a style that makes them easy to spot:

   NbObjects:=WR Count(area;4)
      `Counting the number of references
   For (i;1;NbObjects)
      WR SELECT(area;wr select expression;i)
         `Selecting each reference
      WR GET REFERENCE(area;TableNo;FieldNo;vName;vType)
      WR SET TEXT PROPERTY(area;wr bold;1)
      WR SET TEXT PROPERTY(area;wr text color;wr blue)
         `Applying Blue and Bold to the selection
   End for

See Also

WR Count, WR Replace, WR SELECT PICTURE IN PAGE.