4D v16

WP SELECT

Home

 
4D v16
WP SELECT

WP SELECT 


 

WP SELECT ( {* ;} wpArea {; rangeObj}{; startRange ; endRange} ) 
Parameter Type   Description
Operator in If specified, wpArea is a form object name (string). If omitted, wpArea is an object field or variable.
wpArea  String, Object in Form object name (if * is specified) or 4D Write Pro object variable or field (if * is omitted)
rangeObj  Object in Range object to apply to create a selection
startRange  Longint in Starting offset of text range
endRange  Longint in Ending offset of text range

The WP SELECT command creates a new text selection in the wpArea 4D Write Pro area, based upon the rangeObj or a new range defined by startRange and endRange.

If you pass the optional * parameter, you indicate that wpArea is a form object name (string). If you do not pass this parameter, you indicate that wpArea is a 4D Write Pro object variable or field. If no valid 4D Write Pro area is passed in the wpArea parameter, the command does nothing.

To define the selection range, you can either pass an existing range object in rangeObj, or pass a pair of startRange / endRange boundaries:

  • Second syntax: WP SELECT({* ;} wpArea ; startRange ; endRange)
    In this case, in startRange and endRange you pass values corresponding to the position of the first and last characters to select in the document. You can pass wk start text in startRange to define the beginning of the document, and wk end text in endRange to define the end of the document. Keep in mind that a 4D Write Pro document not only contains visible text but also formatting tags that are included in the range.

Example  

The following code:

 $range2:=WP Get range([SAMPLE]WP;wk start text;12)
 WP SELECT(*;"WParea";$range2)

... will have the same result as:

 WP SELECT(*;"WParea";wk start text;12)



See also 

WP Get range

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language

 
HISTORY 

Created: 4D v15 R4

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)