This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
WP Selection range
|
WP Selection range ( {* ;} wpArea ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
* | Operator |
![]() |
If specified, wpArea is a form object name (string). If omitted, wpArea is an object field or variable. | |||||
wpArea | String |
![]() |
Form object name (if * is specified) or 4D Write Pro object variable or field (if * is omitted) | |||||
Function result | Object |
![]() |
Range or Picture object | |||||
WP Selection range was named WP Get selection in previous versions of 4D Write Pro. It has been renamed for clarity.
The WP Selection range command returns a new range object or a picture object based upon the currently selected content 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 4D Write Pro area is passed in the wpArea parameter, an empty object is returned.
Note: This command can only be used if the wpArea is associated with a form object (i.e. it is displayed in the current form/page).
If an anchored image (picture at a fixed location) is selected in wpArea, WP Selection range returns a picture reference object and not a range object (for more information, please refer to the WP Add picture command description). Otherwise, WP Selection range returns a new range object. For more information on range objects, please refer to Range handling commands.
You want to get the selected text from a 4D Write Pro area:
$range:=WP Selection range(*;"WParea")
Product: 4D
Theme: 4D Write Pro Language
Number:
1340
Created: 4D v15 R4
Modified: 4D v16 R6
Renamed: 4D v17 R5 (WP Selection range)
4D Write Pro Reference ( 4D v20 R7)