4D Write v16

WR SELECT

Home

 
4D Write v16
WR SELECT

WR SELECT 


 

WR SELECT ( area ; type ; begin ; end ) 
Parameter Type   Description
area  Longint in 4D Write area
type  Integer in Type to select
begin  Longint in First character
end  Longint in Last character. Optional for certain values of type

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 typeWR Error text" theme:

Constant Type Value Comment
wr select characters Longint 0 Selects the characters located between begin and end. In this case, this is the same as using WR SET SELECTION.
wr select expression Longint 1 Selects the reference whose rank in the document is defined by begin. end must be omitted.
wr select paragraphs Longint 2 Selects the paragraphs located between begin and end.
wr select ruler Longint 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 Longint 4 Selects the picture whose rank in the document is defined by begin. end must be omitted.
wr select style Longint 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 Longint 6 Selects the word in which the insertion point is located.
wr select page break Longint 7 Selects the page breaks whose rank in the document is defined by begin. end must be omitted.
wr select column break Longint 8 Selects the column breaks whose rank in the document is defined by begin. end must be omitted.
wr select hyphen Longint 9 Selects the hyphen whose rank in the document is defined by begin. end must be omitted.
wr select page number Longint 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 Longint 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 Longint 12 Selects the hyperlink whose rank in the document is defined by begin. end must be omitted.
wr select HTML expression Longint 13 Selects the HTML expression whose rank in the document is defined by begin. end must be omitted.
wr select RTF expression Longint 14 Selects the RTF expression whose rank in the document is defined by begin. end must be omitted.

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

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

 
PROPERTIES 

Product: 4D Write
Theme: WR Text Manipulation
Number: 89189

 
HISTORY 

Modified: 4D Write 6.7

 
ARTICLE USAGE

4D Write Language ( 4D Write v16)