This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
WP INSERT BREAK
|
WP INSERT BREAK ( targetObj ; breakType ; mode {; rangeUpdate} ) | ||||||||
Parameter | Type | Description | ||||||
targetObj | Object |
![]() |
Range or element or 4D Write Pro document | |||||
breakType | Longint |
![]() |
Type of break to insert | |||||
mode | Longint |
![]() |
Insertion mode | |||||
rangeUpdate | Longint |
![]() |
Range update mode | |||||
The WP INSERT BREAK command inserts a new break of the breakType type in the targetObj according to the specified insertion mode and rangeUpdate parameters.
In targetObj, pass:
In breakType, pass one of the following constants from the 4D Write Pro Constants theme to define the type of break to insert:
Constant | Type | Value | Comment |
wk column break | Longint | 3 | Column break: inserts a column break |
wk continuous section break | Longint | 5 | Defines a continuous section break (often used to change the number of columns without starting a new page). |
wk line break | Longint | 0 | Line break (in the same paragraph) |
wk page break | Longint | 2 | Page break: defines a new page |
wk paragraph break | Longint | 4 | Paragraph break: defines a new paragraph |
wk section break | Longint | 1 | Section break: defines a new section |
In the mode parameter, pass a constant to indicate the insertion mode to be used for the break in the destination targetObj:
Constant | Type | Value | Comment |
wk append | Longint | 2 | Insert contents at end of target |
wk prepend | Longint | 1 | Insert contents at beginning of target |
wk replace | Longint | 0 | Replace target contents |
Constant | Type | Value | Comment |
wk exclude from range | Longint | 1 | Inserted contents not included in updated range |
wk include in range | Longint | 0 | Inserted contents included in updated range (default) |
While building invoices, you want to insert page breaks except on the last page:
$nbInvoices:=Records in selection([INVOICE])
For($j;1;$nbInvoices)
... //processing invoices
If($j#$nbInvoices) //insert page break except for last page
WP INSERT BREAK($buildRange;wk page break;wk append;wk exclude from range)
End if
End for
You want to insert a continuous section break to have a single column section and a two-column section on the same page.
$range:=WP Selection range(*;"WParea")
WP INSERT BREAK($range;wk continuous section break;wk append)
$section:=WP Get section(WParea;1)
WP SET ATTRIBUTES($section;wk column count;2)
Product: 4D
Theme: 4D Write Pro Language
Number:
1413
Created: 4D v16
Modified: 4D v17
Modified: 4D v17 R2
Modified: 4D v17 R5
Modified: 4D v19 R3
4D Write Pro Reference ( 4D v20 R7)