[Tip] The trick for the use of returns in calculations used in an RTF_AREA
By Robert Ivens
ROCLASI Software Solutions
As you probably know Servoy comes with 2 rich format fields:
- HTML_AREA
- RTF_AREA
Which is great to use for emails, small letters and mailings.
And with the use of the %%merge code%% feature of Servoy it's a powerful combination.
Lets say you want to use an address-label field in your RTF_AREA. You create a calculation that has all the info in it.
Of course you want to put the address info into different lines so it's correct format.
Now if you want to use returns in calculations used as merge codes in that RTF_AREA then you have a challenge.
In a HTML_AREA you would simply use <BR> and you were done.
But in an RTF_AREA that doesn't work.
Just adding a return code (\r or \n or \r\n) doesn't work either.
So now what?
By taking a look at the RTF specification we see that they use a \par code for a return.
But using this doesn't show a return in Servoy's RTF_AREA. It doesn't show "\par" in the text either so I guess it is recognized as a RTF code.
But something seems to be missing.
After a little experimenting it turns out that you need to add an extra \r (the return code).
So use \par\r for a return in an RTF_AREA when used in a calculation that you use in a RTF_AREA.
Comments (1)