4D Write Pro: use leading characters for tabs

Automatically translated from English

No matter what line of work you are in, you may want to know how to use tabs (left, right, center, decimal tab). They are quite useful as, for example, they allow you to structure documents by separating and indenting your information.

In typography and design, details matter. But getting details just right can be quite time-consuming. 4D Write Pro now provides an additional functionality to fine tune your design in an instant: leading characters. You know the repeated dots or other characters in a table of contents … the ones that go from the end of the text in your first column to the beginning of the text in the second column? That’s them!

User scenario

Leading characters for tabs are used for many purposes. As stated in the introduction, one of the most common scenarios is the simple dots to facilitate reading. Like those in a table of contents for example:

                    Chapter 1 …………………………………………………………………………………15

Another scenario could be pre-filled checks. You fill the left part of numbers or names where money is involved, so the possibility of modification is reduced:

Due :  ***********15,45 € to  Mr xxxxxxxxxxxxxxx Doe

Use leading characters in 4D Write Pro

These leading characters are now available directly from the interface: a new “leading characters” item is present in the contextual menu when you click on an existing tab in the ruler area. This menu allows you to select the character you want from a predefined list ,or you can simply choose your own!

If you prefer to define these leading characters programmatically, you can take advantage of a new selector (wk tab stop leadings) that can be used with the WP SET ATTRIBUTES command:

// Use "-" as tab leading character
WP SET ATTRIBUTES($range;wk tab stop leadings;"-")

You can also set as many leading characters at once using an array:

ARRAY TEXT($_TabLead;0) 
APPEND TO ARRAY($_TabLead;"") 
APPEND TO ARRAY($_TabLead;"") 
APPEND TO ARRAY
($_TabLead;"*") 
APPEND TO ARRAY
($_TabLead;"") 
APPEND TO ARRAY
($_TabLead;"*") 
APPEND TO ARRAY
($_TabLead;"") 
WP SET ATTRIBUTES
($range;wk tab stop leadings;$_TabLead)

Here’s a video demonstrating this feature:

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.