4D Blog

Home Product 4D Write Pro – Insertion and deletion of rows and columns

4D Write Pro – Insertion and deletion of rows and columns

November 18, 2019

Product

You already know that 4D Write Pro allows you to create tables and append rows to them. With 4D v18, we’ve got more thrilling news! We’re excited to announce that managing the insertion and deletion of rows and columns is not only possible, it’s also very easy. This can be done either by programming, thanks to four new commands, or by using the interface (via the widgets or the contextual menu). Keep reading for more details!

 

4DWP: insertion and deletion of rows and columns

Four new commands to manage rows and columns

In order to insert rows and columns, two new commands have been created:  WP Table inserts rows and WP Table insert columns. Both commands return ranges that correspond to parts created inside the table. Following the same logic, two complementary commands have been created to remove rows and columns: WP TABLE DELETE ROWS and WP TABLE DELETE COLUMNS. I’m sure you’ve figured out what they do!

//To insert 2 rows starting at line 3
$row:=WP Table insert rows(WPtable;3;2)
//To delete the second column:
WP TABLE DELETE COLUMNS(WPtable;2;1)

Updated commands

The WP Table get rows, WP Table get columns and WP Table get cells commands have been improved too!

They can still be used to create ranges inside a table as before:

$row:=WP Table get rows($table;3;2)

Now, they can also be used to get information about ranges belonging (or not) to a table. All of these commands can now receive a range as a parameter and will return an object containing useful information such as:

  • .firstRow and .rowCount  (when using WP Table get rows)
  • .firstColumn and .columnCount  (when using WP Table get columns)
  • .firstRow, .rowCount, .firstColumn and .columnCount  (when using WP Table get cells)

For example, let’s say you want to display information about selected cells, here’s the way to go:

$userSelection:=WP Selection range(WParea)
$cells:=WP Table get cells($userSelection)
If ($cells#Null)
 Form.info:=New object
 Form.info.firstRow:=$cells.firstRow
 Form.info.firstColumn:=$cells.firstColumn
 Form.info.rowCount:=$cells.rowCount
 Form.info.columnCount:=$cells.columnCount
End if

Automatic actions

Automatic actions are also available to insert or delete rows and columns according to current selections in a table:

  • insertRowAbove
  • insertRowBelow
  • insertColumnToTheLeft
  • insertColumnToTheRight
  • deleteRows
  • deleteColumns
Discuss

Tags 4D Write Pro, Table, v18, Word processor

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert •After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy