PV GET PREVIOUS ACTIVE CELL
version 6.8
PV GET PREVIOUS ACTIVE CELL (area; column; row)
Parameter | Type | Description | |
area | Longint | 4D View area | |
column | Longint | Cell column number | |
row | Longint | Cell row number |
Description
The PV GET PREVIOUS ACTIVE CELL command returns the coordinates for the preceding active (current) cell for the indicated area in the column and row parameters.
Note: There is no "stack" for current cells, only the preceding cell is known, unlike cells that were first current. It is up to you to manage the memorization of successive current cells if necessary, for example, to install various levels of cancellation.
Example
In the example below, we will create a "rebound" effect for a given cell. Put an event management method into place, which will be called every time the active cell changes:
PV ON EVENT(Area;pv on active cell changed;"EventMethod")
This project method EventMethod causes the user to "bounce" to cell C5. Once this cell has been reached, it is the last current cell that becomes active again, forbidding C5 from being selected by any means: 4D View command, key stroke, mouse, etc.
`Method: EventMethod
`With this method, we will "bounce" to cell C5
C_LONGINT ($1) `4D View area reference
C_LONGINT ($2) `Évent
C_LONGINT ($3) `Modification key code
C_LONGINT($4) `Column number
C_LONGINT($5) `Row number
C_LONGINT($6) `Ascii code of the key
C_LONGINT ($Column;$Row) `Cell coordinates (current then previous)
C_BOOLEAN($0) `Value to return
$0:=False
PV GET CURRENT CELL ($1;$Column;$Row) `Get coordinates
If ($Column=3) & ($Row=5) `Cell C5 is current
PV GET PREVIOUS ACTIVE CELL ($1;$Column;$Row) `Last cell
PV GOTO CELL ($1;$Column;$Row) `Becomes current again
End if
See Also