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

Home

 
4D v20 R7
WP Get section

WP Get section 


 

WP Get section ( targetObj ) | (wpDoc ; sectionIndex ) -> Function result 
Parameter Type   Description
targetObj  Object in Range or element
wpDoc  Object in 4D Write Pro document
sectionIndex  Longint in Section index
Function result  Object in 4D Write Pro section

The WP Get section command returns the first section intersected by the targetObj range or element, or to the specified sectionIndex of the wpDoc document.

  • With the first syntax (using the targetObj parameter), the command returns the first section intersected by the range or the element. You can pass in targetObj:
    • a range, or
    • an element (table / row / paragraph / body / text box / header / footer). You cannot pass a subsection, nor an anchored picture (an error is returned in this case).

    If the range or element belongs to a header or a footer, WP Get section returns the section to which the header or footer is attached. If the range or element is or belongs to a text box, WP Get section always returns the first section, except if it is anchored to a section (in which case the section is returned).

  • With the second syntax (using the wpDoc parameter), the command returns the section corresponding to the specified sectionIndex section (sectionIndex value must be >=1).
    If no section is defined for the specified sectionIndex, the command returns an undefined object (no error is returned). 

Note: Use the WP Get subsection command to get a subsection from a section or from a range.

 

Example  

You want to get the first section:

 C_OBJECT($section)
  // get reference of the first section
 $section:=WP Get section(wpDoc;1)



See also 

WP Get sections
WP Get subsection

 
PROPERTIES 

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

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R3

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)