4D v16

WP Get selection

Home

 
4D v16
WP Get selection

WP Get selection 


 

WP Get selection ( {* ;} wpArea ) -> Function result 
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)
Function result  Object in Range object

The WP Get selection command returns a new text range object (rangeObj) based upon the currently selected text in the wpArea 4D Write Pro area.

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, an empty rangeObj is returned.

This command returns a new rangeObj. A rangeObj is a 4D Write Pro text range object which can be used to handle attributes on a text selection (with the WP GET ATTRIBUTES and WP SET ATTRIBUTES commands). It contains several private read-only attributes (wk range type, wk range start, wk range end and wk range owner) that are used to defined the range itself.

Example  

You want to get the selected text from a 4D Write Pro area:

 $range:=WP Get selection(*;"WParea")



See also 

WP Get paragraphs
WP Get pictures
WP Get range

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1340

 
HISTORY 

Created: 4D v15 R4

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)