4D v13

PV SET CELL FORMULA

Home

 
4D View v13
PV SET CELL FORMULA

PV SET CELL FORMULA 


 

PV SET CELL FORMULA ( area ; column ; row ; formula ) 
Parameter Type   Description
area  Longint in 4D View area
column  Longint in Cell column number
row  Longint in Cell row number
formula  String in Formula

The PV SET CELL FORMULA command sets formula in the cell set by column and row.

Example  

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_INTEGER($CopyNumber`Number of copies to execute
 C_LONGINT($Column;$Row`Coordinates of cell to copy
 C_INTEGER($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

 
PROPERTIES 

Product: 4D
Theme: PV Cell value
Number: 15917

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D View 6.8

 
SEE ALSO 

PV Get cell formula
PV Get cell value type