4D View v16PV SET CELL FORMULA |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D View v16
PV SET CELL FORMULA
|
PV SET CELL FORMULA ( area ; column ; row ; formula ) | ||||||||
Parameter | Type | Description | ||||||
area | Longint |
![]() |
4D View area | |||||
column | Longint |
![]() |
Cell column number | |||||
row | Longint |
![]() |
Cell row number | |||||
formula | String |
![]() |
Formula | |||||
The following example creates an incrementation to the bottom from a numeric type cell. If the value of the latter is later modified, the incrementation will automatically be updated by formulas that we place in the cells with PV SET CELL FORMULA.
C_LONGINT($CopyNumber) //Number of copies to execute
C_LONGINT($Column;$Row) //Coordinates of cell to copy
C_LONGINT($Index) //Loop index
C_TEXT($Name) //Start cell name
PV GET CURRENT CELL(Area;$Column;$Row)
If(PV Get cell value type(Area;$Column;$Row)=pv number type value) //Type verification
//5 by default
$CopyNumber:=Num(Request("How many cells to the bottom do you want to increment?";"5"))
If($CopyNumber>0) //Validate
$Name:=PV Get cell name(Area;$Column;$Row) //Get name
If($Name="") //No name?
$Name:="COL"+String($Column)+"RW"+String($Row) //It currently has one
PV SET CELL NAME(Area;$Column;$Row;$Name) //"COL2RW3" type name
End if
For($Index;$Row+1;$Row+$CopyNumber) //$CopyNumber loop(s)
//Increase
PV SET CELL FORMULA(Area;$Column;$Index;"="+$Name+"+"+String($Index-$Row))
End for
End if
Else //Incorrect type
ALERT("The start cell must be a numeric type")
End if
Product: 4D View
Theme: PV Cell value
Number:
15917
Created: 4D View 6.8
4D View Language ( 4D View v16)