This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
VP Get selection

VP Get selection 


 

VP Get selection ( vpAreaName {; sheet} ) -> Function result 
Parameter Type   Description
vpAreaName  Text in 4D View Pro area form object name
sheet  Longint in Sheet index (current sheet if omitted)
Function result  Object in Range object of cells

The VP Get selection command returns a new range object referencing the current selected cells.

In vpAreaName, pass the name of the 4D View Pro area. If you pass a name that does not exist, an error is returned.

In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted, the current spreadsheet is used by default. You can explicitly select the current spreadsheet with the following constant:

Constant Value Comment
vk current sheet -1 Designates current sheet of the 4D View Pro area (default)

Example  

The following code: 

 $currentSelection:=VP Get selection("myVPArea")
 
  //returns a range object containing:  
  //$currentSelection.ranges[0].column=5
  //$currentSelection.ranges[0].columnCount=2
  //$currentSelection.ranges[0].row=8
  //$currentSelection.ranges[0].rowCount=6

will retrieve the coordinates of all the cells in the current selection:



See also 

VP ADD SELECTION
VP Get active cell
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language
Number: 905261

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R5

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)