4D View v14

PV SET CELL STRING VALUE

Home

 
4D View v14
PV SET CELL STRING VALUE

PV SET CELL STRING VALUE 


 

PV SET CELL STRING VALUE ( area ; column ; row ; value ) 
Parameter Type   Description
area  Longint in 4D View area
column  Longint in Cell column number
row  Longint in Cell row number
value  String in Cell value

The PV SET CELL STRING VALUE command writes the character string value in the cell assigned by column and row.

If value starts with a "=", it will be read as a formula.

Example  

The following example reproduces the "Copy toward the bottom" spreadsheet only for alphanumeric type cells.

 C_INTEGER($CopyNumber)
 C_LONGINT($Column;$Row`Coordinates of cell to copy
 C_INTEGER($Index`Loop index
 C_STRING(80;$Value`Value to copy
 
 $CopyNumber:=Num(Request("How many times should it copy towards the bottom?";"5")) `5 by default
 
 If($CopyNumber>0)
    PV GET CURRENT CELL(Area;$Column;$Row`Cell to copy
    $Value:=PV Get cell string value(Area;$Column;$Row)
    For($Index;$Row+1;$Row+$CopyNumber`$CopyNumber loop(s)
       PV SET CELL STRING VALUE(Area;$Column;$Index;$Value)
    End for
 End if

Tip: This method can be used for any types, or better yet, to call a generic method testing the cell type with PV Get cell value type before calling the "PV Get cell xxx value" then the "PV SET CELL XXX VALUE" commands to copy the value regardless of its type, which can be a good exercise in generic programming.

 
PROPERTIES 

Product: 4D View
Theme: PV Cell value
Number: 15856

 
HISTORY 

Created: 4D View 6.8

 
SEE ALSO 

PV Get cell string value
PV Get cell value type

 
ARTICLE USAGE

4D View Language ( 4D View v11.4)
4D View Language ( 4D View v12)
4D View Language ( 4D v13)
4D View Language ( 4D View v14 R2)
4D View Language ( 4D View v14)
4D View Language ( 4D View v14 R3)
4D View Language ( 4D View v14 R4)