This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
VP SET FORMULAS

VP SET FORMULAS 


 

VP SET FORMULAS ( rangeObj ; formulasCol ) 
Parameter Type   Description
rangeObj  Object in Cell range object
formulasCol  Collection in Collection of formulas

The VP SET FORMULAS command assigns a collection of formulas starting at the specified cell range.

In rangeObj, pass a range of the cell (created with VP Cell) whose formula you want to specify. If rangeObj includes multiple ranges, only the first range is used.

The formulasCol is a two-dimensional collection:

  • The first-level collection contains subcollections of formulas. Each subcollection defines a row.
  • Each subcollection defines cell values for the row. Values must be text elements containing the formulas to assign to the cells. 
    Note: If a 4D method is used, it must be allowed with the SET ALLOWED METHODS command (see Project method references). 

Note: You can remove the formulas in rangeObj by replacing them with an empty string ("").

This code: 

 $formulas:=New collection
 $formulas.push(New collection("MAX(B11,C11,D11)";"myMethod(G4)")) // First row
 $formulas.push(New collection("SUM(B11:D11)";"AVERAGE(B11:D11)")) // Second row
 
 VP SET FORMULAS(VP Cell("ViewProArea";6;3);$formulas// Set the cells with the formulas

will set the formulas in the designated range: 

 

 

 

myMethod:

 $0:=$1*3.33

To remove formulas:

 $formulas:=New collection
 $formulas.push(New collection("";"")) // first collection
 $formulas.push(New collection("";"")) // second collection
 
 VP SET FORMULAS(VP Cell("ViewProArea";0;0);$formulas// Assign to cells



See also 

VP Get formulas
VP Get values
VP SET FORMULA
VP SET VALUES

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language
Number: 9774

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R6

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)