This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
WP Get subsection
|
WP Get subsection ( targetObj ) | (wpSection ; subSectionType ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
targetObj | Object |
![]() |
Range or element | |||||
wpSection | Object |
![]() |
4D Write Pro section | |||||
subSectionType | Longint |
![]() |
Subsection type (wk first page, wk left page, or wk right page) | |||||
Function result | Object |
![]() |
Subsection | |||||
The WP Get subsection command returns first subsection intersected by the targetObj range or element, or to the specified subSectionType subsection of the wpSection section.
If the range or element is or belongs to a header, a footer, or a text box, WP Get subsection returns the subsection to which the targetObj is attached. If the targetObj is not attached to a subsection, a null object is returned.
If the range or element belongs to an anchored picture, an error is returned.
Constant | Type | Value |
wk first page | Longint | 1 |
wk left page | Longint | 2 |
wk right page | Longint | 3 |
You want to apply a blue background on left pages:
C_OBJECT($section;$subsection)
//Retrieve the reference on the first section
$section:=WP Get section(wpDoc;1)
//Retrieve the reference on the left subsection of the first section
$subsection:=WP Get subsection($section;wk left page)
//If the subsection exists, set the background to blue
If($subsection#Null)
WP SET ATTRIBUTES($subsection;wk background color;"#87CEEB")
Else
ALERT("Please, create left and right subsections.")
End if
Product: 4D
Theme: 4D Write Pro Language
Number:
1582
Created: 4D v17 R3
4D Write Pro Reference ( 4D v20 R7)