4D Blog

Home Product 4D Write Pro: Easily locate all the breaks

4D Write Pro: Easily locate all the breaks

April 26, 2021

Product

4D Write Pro documents support five types of breaks:

  • line breaks
  • paragraph breaks
  • page breaks
  • section breaks
  • column breaks

 

Sometimes, you need to locate a certain type of break to replace it with another, or simply delete all its occurrences in the document. To make this possible, we developed a new function: WP Get breaks.

Get user breaks

New command

WP Get breaks returns by default all five types of breaks. These are explicit breaks, meaning breaks that have been intentionally entered by the user, either on their keyboard or from a menu or context menu.

The other breaks, caused by the page layout, for example, are not taken into account because they’ve been inserted implicitly, for display or printing purposes. They are not part of the document.

This command can also, on-demand, return only a given type of break, such as page breaks for instance.

The result is very easy to use because this new command returns a collection of ranges that are directly usable by other commands that take this type of argument as a parameter.

Some examples

Thanks to this command, it’s now easier to replace section breaks with simple page breaks.

It’s also possible to locate multiple paragraph breaks. You can therefore delete duplicates or replace all of them with page breaks, replace column breaks with paragraph breaks, and so on.

Code Sample 

The sample code below replaces all the line breaks with paragraph breaks:

// Find all the line breaks
$_filteredBreaks:=WP Get breaks(WParea; wk line break)
// Replace them with paragraph breaks
For each ($break; $_filteredBreaks)
  WP INSERT BREAK($break; wk paragraph break; wk replace)
End for each 

Easy, right?

Next STEPS

You’ll find everything you need to know in the documentation. And as always, for all kinds of questions or feedback, feel free to join us on the 4D forum.

Discuss

Tags 4D Write Pro, Document creation, Section break, v19, Word processor

Latest related posts

  • October 23, 2025

    Starting Qodly studio is just two clicks away

  • October 22, 2025

    Localize your Qodly Pages: A Practical Guide

  • October 21, 2025

    New Way to Control Your HTTP Responses

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

  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming 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