4D Write Pro: Where are my formulas?

When a 4D Write Pro document contains external elements resulting from expressions or formulas, they are visible when the “Display expressions” mode is used. Still, they are blended into the text when the values are displayed. This is what you want for a final document, but it is sometimes useful to easily view these calculated values while writing the document. Well, 4D v19 R3 is giving you new display options for this purpose!

HDI Highlight formulas

Two new options are available

Several display options are already available for 4D Write Pro documents. We remind you that these options, which, as indicated by their name, only concern the display, are not stored in the document itself.

In addition to these options, there is now a wk formula highlight option, which can have 4 possible values:

  • 0: no highlighting of formulas and values
  • 1: highlight formulas only (default value)
  • 2: highlight values only
  • 3: highlight formulas and values


Let’s add some Colors

The default highlight color is grey, but why not use fuchsia or indigo?

To define this, an additional option has been created: wk formula highlight color. It allows you to either set the highlight color directly or use the system color picker.


$viewProperties:=New object
$viewProperties[wk visible references]:=True
$viewProperties[wk formula highlight]:= wk references+wk values
$viewProperties[wk formula highlight color]:="lightGreen"
WP SET VIEW PROPERTIES(*; "WParea"; $viewProperties)

Not in the mood to code?

In many cases, it is becoming easier to proceed without code. Standard actions are there for that, making your life easier!

They can be associated with checkboxes, standard buttons, or dropdown lists.

Form object type Action Possible values
Checkbox visibleReference  
Checkbox formulaHightlightReferences  
Checkbox formulaHightlightValues  
Dropdown list formulaHightlight  
Button formulaHighlightColor


Button formulaHighlightColor


Dropdown list formulaHighlightColor

16 predefined values or “automatic”

A user-friendly interface 

Your need can be to define the availability of the highlight and its color according to users, or a graphic charter, or to let them choose their preferred display.

Everyone now has the possibility to do what they want! Enjoy!

For more details, the documentation can be found here.

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.