4D Write Pro – More control when using formulas

As a 4D Write Pro user, you’ve most likely used expressions (or more recently, formulas) to automatically fill in certain parts of your documents. These formulas can return “raw” text or images. In the case of text, they may contain line breaks. The question is how should these line breaks be handled when they are processed inside 4D Write Pro documents? This blog post provides the answers … keep reading!

HDI: Manage special characters returned by formulas

Line breaks simply didn’t exist in 4D Write. When a “carriage return” was typed, a new paragraph had to be created. Today, 4D Write Pro gives you two possibilities:

  • insert a new line inside an existing paragraph
  • create a new paragraph


So what to do if text returned by a formula contains one or more carriage returns? Should they be considered as paragraph breaks or simple line breaks? Until now and in contrast to 4D Write, 4D Write Pro considered them as simple line breaks. As of 4D v18 R4, the choice is yours thanks to a new document property that defines how they should be treated!

If you want carriage returns to be treated as paragraph breaks:

WP SET ATTRIBUTES(WParea;wk break paragraphs in formulas;True)

If you want carriage returns to be treated as line breaks:

WP SET ATTRIBUTES(WParea;wk break paragraphs in formulas;False)

That’s it! It’s as simple as that 🙂

Bonus: You can change your mind at any time. It’s a document property that can be modified according to your needs and those of your customers!

Learn more about this feature on the doc center.

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.