WR SELECT

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

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.

TypeSelectionComments
0CharactersSelects the characters located between begin and end. In this case, this is
the same as using WR SET SELECTION.
14D ExpressionSelects the reference whose rank in the document is defined by begin.
end must be omitted.
2ParagraphsSelects the paragraphs located between begin and end.
3Ruler (paragraphSelects the paragraphs that use the Xth ruler (whose rank in the document
attributes)starts at the beginning of the text). end must be omitted.
4PictureSelects the picture whose rank in the document is defined by begin. end
must be omitted.
5Style (characterSelects the words that use the Xth style (whose rank in the document
attributes)starts at the beginning of the text). end must be omitted.
6WordSelects the word in which the insertion point is located.
7Page breakSelects the page breaks whose rank in the document is defined by begin.
end must be omitted.
8Column breakSelects the column breaks whose rank in the document is defined by begin.
end must be omitted.
9HyphenSelects the hyphen whose rank in the document is defined by begin. end
must be omitted.
10Page number 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.
11Date and timeSelects 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.
12HyperlinkSelects the hyperlink whose rank in the document is defined by begin.
end must be omitted.
13HTML ExpressionSelects the HTML expression whose rank in the document is defined by
begin. end must be omitted.
14RTF ExpressionSelects 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;7;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;1;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.


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