4D v17WP Get selection | 
            ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
                 
                
  | 
                
			
                    
                         
    4D v17
 
WP Get selection 
                                
                                
        
 | 
                |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WP Get selection ( {* ;} 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 | |||||
The WP Get selection 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 valid 4D Write Pro area is passed in the wpArea parameter, an empty object is returned.
Note: This command can only be used if a wpArea is associated to a form object (i.e., it's displayed on the form).
If an anchored image (picture at a fixed location) is selected in wpArea, WP Get selection returns a picture reference object and not a range object (for more information, please refer to the WP Add picture command description). Otherwise, WP Get selection 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 Get selection(*;"WParea")
									WP Create paragraph range
									
									WP Create picture range
									
									WP Create range
									
	Product:  4D
	Theme:  4D Write Pro Language
	Number:  
        1340
        
        
        
	
	Created:  4D v15 R4
	Modified:  4D v16 R6
	
	4D Write Pro Reference ( 4D v17)
	
	
	
Add a comment