4D v16

WP INSERT BREAK

Home

 
4D v16
WP INSERT BREAK

WP INSERT BREAK 


 

WP INSERT BREAK ( rangeObj ; breakType ; mode {; rangeUpdate} )  
Parameter Type   Description
rangeObj  Object in 4D Write Pro range object
breakType  Longint in Type of break to insert
mode  Longint in Insertion mode
rangeUpdate  Longint in Range update mode

The WP INSERT BREAK command inserts a new break of the breakType type in the rangeObj range according to the specified insertion mode and rangeUpdate parameter.

In rangeObj, pass a valid 4D Write Pro standard range object. A rangeObj is a part of a 4D Write Pro document; it can be created using the , WP Get bookmark range or WP Get range commands.

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 line break Longint 0 Line break (in the same paragraph)
wk page break Longint 2 Page break: defines a new page
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 rangeObj range:
 

Constant Type Value Comment
wk append Longint 2 Insert contents at end of range
wk prepend Longint 1 Insert contents at beginning of range
wk replace Longint 0 Replace range contents

 

In the optional rangeUpdate parameter, you can pass one of the following constants to specify whether or not the inserted contents are included in the resulting range:
 

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)

 

Note: If you do not pass the rangeUpdate parameter, by default the inserted contents are included in the resulting range.

Example  

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



See also 

WP INSERT DOCUMENT

 
PROPERTIES 

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

This command can be run in preemptive processes

 
HISTORY 

New
Created: 4D v16

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)