KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Programmatically Set Left Paragraph Margin in 4D Write Pro
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: March 8, 2021

To programmatically set the left paragraph margin in a 4D Write Pro docuement, pass a negative value for the text indent attribute.



Here is an example of setting the left paragraph margin at 2cm for the paragraph range.

$prange_o:=WP Paragraph range(wp)
WP SET ATTRIBUTES($prange_o;wk text indent;"-2cm")

When a negative value is passed for the text indent attribute, the left paragraph margin will be shifted by the specifed value to the right and the first line indent will be re-positioned at the left margin.

When a positive value is passed, the opposite will happen. The first line indent will be shifted by the specified value to the right and the left paragraph margin will be re-positioned at the left margin instead.

By default, the left margin is at 0.