# variable message with newlines

**URL:** <https://www.dynamicsuser.net/t/variable-message-with-newlines/9788>\
**Category:** Developers Forum\
**Created:** [March 16, 2005, 2:51pm UTC](https://www.dynamicsuser.net/t/variable-message-with-newlines/9788 "2005-03-16T14:51:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Sharman](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Chris\_Sharman](https://www.dynamicsuser.net/u/Chris_Sharman)\
**Post date:** [March 16, 2005, 2:51pm UTC](https://www.dynamicsuser.net/t/variable-message-with-newlines/9788/1 "2005-03-16T14:51:08Z")

</div>

I know how to use message(’%1%2%3’,line1, line2, line3); How can I have a variable number of lines ? I’ve a report which builds its message as it progresses, and displays it on completion, but the ‘’ characters get displayed as just ‘’, rather than newline: onaftergetrecord … msg := msg + ‘my data NNN’; … onpostreport message(’%1’,msg); What do I put into message to get (a variable number of) newlines ?

---

<div class="post-metadata">

**Author:** ![stryk](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@stryk](https://www.dynamicsuser.net/u/stryk)\
**Post date:** [March 16, 2005, 3:34pm UTC](https://www.dynamicsuser.net/t/variable-message-with-newlines/9788/2 "2005-03-16T15:34:20Z")

</div>

You could define two variables of type “Char” and assign those values: CR := 13; LF := 10; In your report you could do this: msg := msg + mydata + FORMAT(CR) + FORMAT(LF); Have not tested, maybe it works …

---

<div class="post-metadata">

**Author:** ![nilsm](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nilsm](https://www.dynamicsuser.net/u/nilsm)\
**Post date:** [March 16, 2005, 4:09pm UTC](https://www.dynamicsuser.net/t/variable-message-with-newlines/9788/3 "2005-03-16T16:09:31Z")

</div>

Chris,

> **quote:**
> 
> | message(‘%1’,msg); |
> | --- |

use MESSAGE(msg); instead. When using MESSAGE(msg); Navision “parses” the msg variable and interprets the " " within the text as line breaks, whereas message(‘%1’,msg) takes the msg text as it is… Saludos Nils

---

<div class="post-metadata">

**Author:** ![Chris\_Sharman](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Chris\_Sharman](https://www.dynamicsuser.net/u/Chris_Sharman)\
**Post date:** [March 17, 2005, 8:13am UTC](https://www.dynamicsuser.net/t/variable-message-with-newlines/9788/4 "2005-03-17T08:13:44Z")

</div>

That’s done it - thanks. I thought the first param had to be a constant.
