WP New subsection
WP New subsection ( wpSection ; subSectionType ) -> Function result
Parameter | Type | Description | |
---|---|---|---|
wpSection | Object | → | 4D Write Pro section |
subSectionType | Longint | → | Subsection type (wk first page, wk left page, or wk right page) |
Function result | Object | ← | New subsection |
Description
The WP New subsection command creates and returns a new subsection of the subSectionType type in the wpSection 4D Write Pro section.
In wpSection, pass the section where you want to create a new subsection. The section can be obtained using the WP Get sections or WP Get section commands.
The subSectionType parameter specifies the subsection to create. You can pass one of the following constants:
Constant | Type | Value |
---|---|---|
wk first page | Longint | 1 |
wk left page | Longint | 2 |
wk right page | Longint | 3 |
Note: Creating a left page or right page subsection will automatically create the opposite subsection. For example, if you create a left page subsection, the right page subsection is automatically defined.
If the subSectionType already exists, an error is returned.
Example
You want to create left and right subsections:
var $section;$subsection : Object
// get first section
$section:=WP Get section(wpDoc;1)
// Create the left section - the right section is created automatically
$subsection:=WP New subsection($section;wk left page)