These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#24634 - 06/26/09 02:24 PM conditional text with variable data
ourtown Offline

Registered: 10/09/08
Posts: 40
Loc: Tampa, Fl USA
Is there a way for me to set an address block for example on a conditional basis without adjust the variable field for the entire layout? For example this is my address block.
@First@ @Last@
@City@, @St@ @Zip@

If the First, Last fields are blank I don't want a blank line in my address block. I would prefer it to display as

@City@, @St@ @Zip@

Is there an expression I could create to do this? I have a few different layouts already. I am hoping to avoid duplicating ones I have and complicating my current layout expressions to include those fields being empty skip. I could also apply this to other functions. Thanks for your help.

#24635 - 06/27/09 12:21 AM Re: conditional text with variable data
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
How about replacing @First@ and @Last@ by a new variable with an expression like ..

TRIM(@First@ & " " & @Last@)
.. so you can use Remove Empty Lines?

And I know this won't help you right now, but this will no longer be necessary in the next version of PSM. It will consider a line to be empty if it only consists of whitespace.