Saltar para o conteúdo principal
Versão: 21 R3

WP Insert break

WP Insert break ( targetObj : Object ; breakType : Integer ; mode : Integer {; rangeUpdate : Integer} ) : Object

ParâmetroTipoDescrição
targetObjObject→Intervalo ou elemento ou documento 4D Write Pro
breakTypeInteger→Type of break to insert
modeInteger→Modo de inserção
rangeUpdateInteger→Modo de atualização de intervalo
ResultadoObject←Text range of the break character

Descrição​

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, and returns the text range of the break character

Em targetObj, passe:

  • um intervalo, ou
  • an element (table / row / paragraph / body / header / footer / inline picture / section / subsection), or
  • um documento 4D Write Pro

In breakType, pass one of the following constants from the 4D Write Pro Constants theme to define the type of break to insert:

ParâmetrosTipoValorComentário
wk column breakInteger3Column break: inserts a column break
wk continuous section breakInteger5Defines a continuous section break (often used to change the number of columns without starting a new page).
wk line breakInteger0Line break (in the same paragraph)
wk page breakInteger2Page break: defines a new page
wk paragraph breakInteger4Paragraph break: defines a new paragraph
wk section breakInteger1Section 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:

ParâmetrosTipoValorComentário
wk appendInteger2Inserir conteúdo no final do alvo
wk prependInteger1Inserir conteúdo no início do alvo
wk replaceInteger0Replace target contents
  • If targetObj is a range, you can use the optional rangeUpdate parameter to pass one of the following constants to specify whether or not the inserted contents are included in the resulting range:
ParâmetrosTipoValorComentário
wk exclude from rangeInteger1Conteúdos inseridos não incluídos no intervalo atualizado
wk include in rangeInteger0Conteúdo inserido incluído no intervalo atualizado (padrão)

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

  • Se targetObj não for um intervalo, rangeUpdate será ignorado.

Exemplo 1​

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

Exemplo 2​

You want to insert a continuous section break to have a single column section and a two-column section on the same page.

  1. Insert a continuous section break at the selection to create a new section:
$range:=WP Selection range(*;"WParea")
WP Insert break($range;wk continuous section break;wk append)

2. Set the column count to 2 for the first section:

$section:=WP Get section(WParea;1)
WP SET ATTRIBUTES($section;wk column count;2)

Veja também​

WP Get breaks
WP Insert document body