VP SHOW CELL
VP SHOW CELL ( rangeObj : Object { ; vPos : Integer; hPos : Integer } )
Parameter | Type | Description | |
---|---|---|---|
rangeObj | Object | -> | Range object |
vPos | Integer | -> | Vertical view position of cell or row |
hPos | Integer | -> | Horizontal view position of cell or row |
Description
The VP SHOW CELL
command vertically and horizontally repositions the view of the rangeObj.
In rangeObj, pass a range of cells as an object to designate the cells to be viewed. The view of the rangeObj will be positioned vertically or horizontally (i.e., where rangeObj appears) based on the vPos and hPos parameters. The vPos parameter defines the desired vertical position to display the rangeObj, and the hPos parameter defines the desired horizontal position to display the rangeObj.
The following selectors are available:
Selector | Description | Available with vPos | Available with hPos |
---|---|---|---|
vk position bottom | Vertical alignment to the bottom of cell or row. | X | |
vk position center | Alignment to the center. The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position left | Horizontal alignment to the left of the cell or column | X | |
vk position nearest | Alignment to the closest limit (top, bottom, left, right, center). The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position right | Horizontal alignment to the right of the cell or column | X | |
vk position top | Vertical alignment to the top of cell or row | X |
This command is only effective if repositioning the view is possible. For example, if the rangeObj is in cell A1 (the first column and the first row) of the current sheet, repositioning the view will make no difference because the vertical and horizontal limits have already been reached (i.e., it is not possible to scroll any higher or any more to the left). The same is true if rangeObj is in cell C3 and the view is repositioned to the center or the bottom right. The view remains unaltered.
Example
You want to view the cell in column AY, row 51 in the center of the 4D View Pro area:
$displayCell:=VP Cell("myVPArea";50;50)
// Move the view to show the cell
VP SHOW CELL($displayCell;vk position center;vk position center)
Result:
The same code with the vertical and horizontal selectors changed to show the same cell positioned at the top right of the 4D View Pro area:
$displayCell:=VP Cell("myVPArea";50;50)
// Move the view to show the cell
VP SHOW CELL($displayCell;vk position top;vk position right)
Result:
See also
VP Cell
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION