This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
WP TABLE DELETE ROWS

WP TABLE DELETE ROWS 


 

WP TABLE DELETE ROWS ( targetObj ) | ( tableRef ; rowNumber {; numRows} )  
Parameter Type   Description
targetObj  Object in Range or element or 4D Write Pro document
tableRef  Object in Table reference
rowNumber  Longint in Row index number
numRows  Longint in Number of rows to delete (default value = 1)

The WP TABLE DELETE ROWS command removes one or several row(s) from a 4D Write Pro table.

This command supports two syntaxes:

  • If you pass a targetObj as the first parameter, the command will remove all the rows in table(s) intersecting the target. targetObj can contain: 
    • a range, or
    • an element (row / paragraph / body / header / footer / inline picture / section / subsection), or 
    • a 4D Write Pro document. 

      If targetObj intersects with several tables, touched rows in all tables are removed. If targetObj does not intersect with a table, the command does nothing (no error is generated). 
      With this syntax, the numRows parameter (if passed) is ignored.
  • If you pass both a tableRef and a rowNumber, the command will remove the row(s) in the designated table, starting at the specified row index number.
    With this syntax, the optional numRows parameter defines the number of rows to remove from tableRef. By default, if this parameter is omitted, one row is removed.

Removing all rows of a table will remove the entire table.

Example  

You want to delete two rows from the Invoice table. This code:

 C_OBJECT($table)
 
 $table:=WP Get element by ID(WParea;"Invoice") //retrieve "Invoice" table
 
 WP TABLE DELETE ROWS($table;3;2) //remove 2 rows after 2nd row (3rd position)

Will remove the two rows from the correct location:



See also 

WP TABLE DELETE COLUMNS

 
PROPERTIES 

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

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)