Saltar al contenido principal
Versión: 20 R9 BETA

WP DELETE SECTION

WP DELETE SECTION ( section )
WP DELETE SECTION ( wpDoc ; indexNumber {; count} )

ParámetrosTipoDescripción
secciónObjectSección 4D Write Pro
wpDocObjectDocumento 4D Write Pro
indexNumberIntegerÍndice de la sección a eliminar
countIntegerNúmero de secciones a eliminar

Descripción

El comando WP DELETE SECTION elimina el objeto section pasado, o elimina una o más secciones comenzando por indexNumber y dependiendo del count pasado. When a section is removed, everything associated with it, including the header, footer, part of the body, anchored pictures, text boxes, and the ending section break (whether a section break or continuous section break), is also removed.

An error is raised if the WP DELETE SECTION command requests to delete all sections or if the document contains only one section.

WP DELETE SECTION re-indexes the anchorSection attribute of text boxes and pictures to adjust their anchors to their sections after changes. For example, if a document has four sections and the second section is deleted, sections 3 and 4 will become sections 2 and 3 and text boxes and pictures that were previously anchored to sections 3 and 4 will now be anchored to sections 2 and 3.

nota

If an image or textbox is anchored to a page (e.g., page 20) and this page no longer exists after a section has been deleted, the image (or textbox) will remain in the document and will reappear on page 20 if this page ever exists again later.

Ejemplos

Para eliminar la primera sección del documento:


wpDoc:=WP Import document("test.wp")
// remove section 1 only (without error unless there is only one section in the document)
WP DELETE SECTION(wpDoc ; 1)

Eliminar la sección 5 del documento:


wpDoc:=WP Import document("test.wp")
// remove section 5 only
WP DELETE SECTION(wpDoc ; 5)

To remove section 5, 6 and 7 of the document:

 
wpDoc:=WP Import document("test.wp")
WP DELETE SECTION(wpDoc ; 5 ; 3 )

Para eliminar todas las secciones a partir de la 5:

 
wpDoc:=WP Import document("test.wp")
// remove all sections starting at section 5 (without error unless section 5 does not exist)
WP DELETE SECTION(wpDoc ; 5 ; MAXLONG )

Para recuperar y eliminar la sección 5:

 
wpDoc:=WP Import document("test.wp")
// get section 5
$section:=WP Get section(wpDoc, 5)
// remove $section
WP DELETE SECTION($section)

Ver también

WP Get section
WP RESET ATTRIBUTES