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

Home

 
4D v20 R7
WP Get sections

WP Get sections 


 

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

The WP Get sections command returns a collection of all sections defined in the targetObj parameter.

In the targetObj parameter, you can pass:

  • a range, or
  • an element (table / row / paragraph / body / header / footer / text box / picture), or
  • a 4D Write Pro document

If the range or element belongs to a header or a footer, WP Get sections returns the section to which the header or footer is attached.

For text boxes and anchored pictures, WP Get sections returns:  

  • a collection containing a single section if the element is anchored to a section,
  • a collection with all sections if the element is anchored to all sections,
  • an empty collection if the element is anchored to the embedded view or to a page number.

For more information about sections, please refer to the Handling headers, footers, and sections paragraph.

 

Example  

You want to change an attribute for the last section of the 4D Write Pro area:

 C_COLLECTION($colSections)
 $colSections:=WP Get sections(wpDoc)
 WP SET ATTRIBUTES($colSections[$colSections.length-1];wk column count;3)



See also 

WP Get section

 
PROPERTIES 

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

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R3
Modified: 4D v19 R8

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)