Saltar al contenido principal
Versión: 20 R9 BETA

WP Insert break

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

ParámetrosTipoDescripción
targetObjObjectRango o elemento o documento 4D Write Pro
breakTypeIntegerTipo de ruptura a insertar
modeIntegerModo de inserción
rangeUpdateIntegerModo de actualización del rango
ResultadoObjectRango de texto del caracter de ruptura

Descripción

El comando WP Insert break inserta una nueva ruptura de tipo breakType en el targetObj de acuerdo con los parámetros de inserción mode y rangeUpdate especificados, y devuelve el rango de texto del caracter de ruptura

En targetObj, pase:

  • un rango, o
  • an element (table / row / paragraph / body / header / footer / inline picture / section / subsection), or
  • un 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:

ConstanteTipoValorComentario
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 breakInteger0Salto de línea (en el mismo párrafo)
wk page breakInteger2Salto de página: define una nueva página
wk paragraph breakInteger4Salto de párrafo: define un nuevo párrafo
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:

ConstanteTipoValorComentario
wk appendInteger2Insertar el contenido al final del objetivo
wk prependInteger1Insertar el contenido al principio del objetivo
wk replaceInteger0Sustituir contenido de destino
  • 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:
ConstanteTipoValorComentario
wk exclude from rangeInteger1Contenido insertado no incluido en el rango actualizado
wk include in rangeInteger0Contenido insertado incluido en el rango actualizado (por defecto)

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

  • Si targetObj no es un rango, rangeUpdate se ignora.

Ejemplo 1

While building invoices, you want to insert page breaks except on the last page:

 $nbInvoices:=Records in selection([INVOICE])
For($j;1;$nbInvoices)
... //procesando facturas
If($j#$nbInvoices) //insertar ruptura de página excepto para la última página
WP Insert break($buildRange;wk page break;wk append;wk exclude from range)
End if
End for

Ejemplo 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)

Ver también

WP Get breaks
WP Insert document body