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

Home

 
4D v20
WP Get formulas

WP Get formulas 


 

WP Get formulas ( targetObj ) -> Function result 
Parameter Type   Description
targetObj  Object in Range or element or 4D Write Pro document
Function result  Collection in Collection of formulas

The WP Get formulas command returns a collection of all formulas defined in targetObj.

In the targetObj parameter, you can pass:

  • a range, or
  • an element (table / row / cell(s) / paragraph / body / header / footer / section / subsection / inline or anchored picture / text box), or
  • a 4D Write Pro document.

Note: When you pass a section in targetObj, only image formulas or formulas in text boxes anchored to this section or all sections are returned. If anchored to a page or to the embedded view, their formulas are not returned. Pass the document in targetObj to get all anchored element formulas. 

 

Returned value

WP Get formulas returns a collection of formula objects, each of them containing one or more of the following properties:

 

PropertyTypeDescription
[ ].formulaObjectThe formula string is available through [ ].formula.source. The formula is a copy of the formula found in the target. If you want to modify the formula, it must be re-inserted in the document to be taken into account
[ ].rangeObjectRange of the formula (not returned for anchored picture formulas)
[ ].anchoredIDTextID of anchored picture (returned for anchored picture formulas only)
[ ].ownerObject4D Write Pro document

Notes:

  • If you passed a subsection as target, formulas of the parent section are returned.
  • If several formulas are returned, the collection is ordered with respect to the formula order in the target, except for targets of type document and section (any order in this case). 

Example  

To get all formulas in a document:

 C_COLLECTION($formulas)
 $formulas:=WP Get formulas(WriteProArea)

 

To get all formulas in the first section of a document:

 C_COLLECTION($formulas)
 $formulas:=WP Get formulas(WP Get section(WriteProArea;1))

 

To get the formulas of all anchored pictures in a document:

 C_COLLECTION($formulas)
 $formulas:=WP Get formulas(WriteProArea).query("anchoredID # null")



See also 

Managing formulas
WP COMPUTE FORMULAS
WP FREEZE FORMULAS
WP Get links
WP INSERT FORMULA

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1702

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18 R2

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20)