PV GET CELL FIELD
version 6.8
PV GET CELL FIELD (area; column; row; table; field)
Parameter | Type | Description | |
area | Longint | 4D View area | |
column | Longint | Cell column number | |
row | Longint | Cell row number | |
table | Integer | Table number | |
field | Integer | Field number |
Description
The PV GET CELL FIELD command returns, in the table and field parameters, the number for tables and fields linked to the cell set by column and row.
Examples
1. Refer to the example for the PV SET CELL FIELD command.
2. The following example illustrates the use of the PV GET CELL FIELD command in a method enabling the sorting of dynamic columns when their header is clicked on. The area only contains dynamic columns. We begin by installing the EventMethod callback method that will be called in the event of a click in the area:
PV ON EVENT(area;pv on clicked;"EventMethod")
This statement catches any clicks in the area. The EventMethod method will enable us to detect clicks in the column headers and to sort the data as a consequence.
`EventMethod Method
C_BOOLEAN($0)
C_LONGINT($1;$2;$3;$4;$5;$6)
C_INTEGER($tableNum;$fieldNum)
If($5=0) `If the click takes place in a header
$0:=True `Cancels the event
PV GET CELL FIELD(area;$4;1;$tableNum;$fieldNum) `Data to be sorted
ORDER BY(Table($tableNum)->;Field($tableNum;$fieldNum)->;>) `Sorting 4D data
End if `Linked values in the columns are automatically sorted
See Also