replaceTag issue

Hi,

I have the following text in a text-area field called field1:

hi,
how are you?
I am fine!

I have an RTF-file on my computer with this tag in it: %%field1%%
In Servoy I call the function, to replace the tags: replaceTags()
If I open the RTF-file in Word the line-breaks are gone, so I see this:

hi,how are you?I am fine!

Does someone know how I can fix this?

Hi Harjo,

You need to replace the \n’s with \par\n .
So I guess you need to create an unstored calculation that replaces the returns into RTF codes and use that as source for your tag.

For more information on RTF returns see http://www.servoymagazine.com/home/2005 … ick_f.html

Hope this helps.

I don’t get it!

if I do this in Servoy: var b = utils.stringReplace(a, ‘\n’, '\par\n ')

i’ll get this in my calc and in the rtffile:

hi,parhow are you?parI am fine!

You need to escape the slash.
So use \par\n.

Thanks, that did the trick!