version 6.7 (Modified)
WR SELECT (area; type; begin{; end})
| Parameter | Type | Description | |
| area | Longint | 4D Write area | |
| type | Integer | Type to select | |
| begin | Longint | First character | |
| end | Longint | Last character. Optional for certain values of type |
Description
The WR SELECT command selects text defined by type, begin, and end.
| Type | Selection | Comments |
| 0 | Characters | Selects the characters located between begin and end. In this case, this is |
| the same as using WR SET SELECTION. | ||
| 1 | 4D Expression | Selects the reference whose rank in the document is defined by begin. |
| end must be omitted. | ||
| 2 | Paragraphs | Selects the paragraphs located between begin and end. |
| 3 | Ruler (paragraph | Selects the paragraphs that use the Xth ruler (whose rank in the document |
| attributes) | starts at the beginning of the text). end must be omitted. | |
| 4 | Picture | Selects the picture whose rank in the document is defined by begin. end |
| must be omitted. | ||
| 5 | Style (character | Selects the words that use the Xth style (whose rank in the document |
| attributes) | starts at the beginning of the text). end must be omitted. | |
| 6 | Word | Selects the word in which the insertion point is located. |
| 7 | Page break | Selects the page breaks whose rank in the document is defined by begin. |
| end must be omitted. | ||
| 8 | Column break | Selects the column breaks whose rank in the document is defined by begin. |
| end must be omitted. | ||
| 9 | Hyphen | Selects the hyphen whose rank in the document is defined by begin. end |
| must be omitted. | ||
| 10 | Page 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. | ||
| 11 | Date and time | 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. | ||
| 12 | Hyperlink | Selects the hyperlink whose rank in the document is defined by begin. |
| end must be omitted. | ||
| 13 | HTML Expression | Selects the HTML expression whose rank in the document is defined by |
| begin. end must be omitted. | ||
| 14 | RTF Expression | 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;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.