Skip to main content
Version: Next

WP New subsection

WP New subsection ( wpSection ; subSectionType ) -> Function result

ParameterTypeDescription
wpSectionObject🡒4D Write Pro section
subSectionTypeLongint🡒Subsection type (wk first page, wk left page, or wk right page)
Function resultObject🡐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:

ConstantTypeValue
wk first pageLongint1
wk left pageLongint2
wk right pageLongint3

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)

See also

WP DELETE SUBSECTION
WP Get subsection