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

Home

 
4D v20 R7
WP TABLE DELETE COLUMNS

WP TABLE DELETE COLUMNS 


 

WP TABLE DELETE COLUMNS ( targetObj ) | ( tableRef ; colNumber {; numColumns} )  
Parameter Type   Description
targetObj  Object in Range or element or 4D Write Pro document
tableRef  Object in Table reference
colNumber  Longint in Column number
numColumns  Longint in Number of columns to delete (default value = 1)

The WP TABLE DELETE COLUMNS command removes one or several column(s) from a 4D Write table.

This command supports two syntaxes:

  • If you pass a targetObj as the first parameter, the command will remove all of the columns 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 columns 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 numColumns parameter (if passed) is ignored.
  • If you pass both a tableRef and a colNumber, the command will remove the column(s) in the designated table, starting at the specified column index.
    With this syntax, the optional numColumns parameter defines the number of columns to remove from tableRef. By default, if this parameter is omitted, one column is removed.

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

Example  

You want to delete one column from the Invoice table. This code:

 C_OBJECT($table)
 
 $table:=WP Get element by ID(WParea;"Invoice") //retrieve "Invoice" table
 
 WP TABLE DELETE COLUMNS($table;2;1) //remove the second column

 

Will remove the column from the correct location:



See also 

WP TABLE DELETE ROWS

 
PROPERTIES 

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

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)