New line in variable

Greetings, in a variable I want to assign a value of 3 or more lines or paragraphs as follows:

Paragraph 1
Paragraph 2
Paragraph 3

however it does not work .... everything puts it on one line .... is it a Macrodroid error or is it something that I am doing wrong ????

I am using the New line option in the 3 point box but it does not work the result puts it like this:

Paragraph 1 \n Paragraph 2 \n Paragraph 3
 

Attachments

  • IMG_20210716_070108.jpg
    IMG_20210716_070108.jpg
    48.4 KB · Views: 14

420

Active member
Greetings, in a variable I want to assign a value of 3 or more lines or paragraphs as follows:

Paragraph 1
Paragraph 2
Paragraph 3

however it does not work .... everything puts it on one line .... is it a Macrodroid error or is it something that I am doing wrong ????

I am using the New line option in the 3 point box but it does not work the result puts it like this:

Paragraph 1 \n Paragraph 2 \n Paragraph 3
the new line symbol won't be converted to a new line in the variable itself, if you display your variable in a pop-up/dialog or write it to the user log the new line symbols should be converted to actual new lines.
 
the new line symbol won't be converted to a new line in the variable itself, if you display your variable in a pop-up/dialog or write it to the user log the new line symbols should be converted to actual new lines.
I mean how can I get it to do a line break. Is that possible??
 

Dm114

Well-known member
I mean how can I get it to do a line break. Is that possible??
It all depends where you want it to be displayed. As 420 said, in a pop-up message or dialog, '\n' will be translated to a physical new line. But while writing to a text file you have to insert a physical new line.

Another way is to create a string variable (global or local, according to your needs) containing a 'physical' new line character (at creation time for a local variable or in the 'Variables' menu or sub-menu inside a macro) and to use it instead of '\n' wherever needed.
 
Top