New lines in dialogues

Is there a syntax available for inserting new paragraph breaks into dialogues? Specifically, the plugin.dialogs.showInfoDialog().

Thanks.

Yes, it’s javascript: \n

Is there a syntax available for inserting new paragraph breaks into dialogues? Specifically, the plugin.dialogs.showInfoDialog().

\n is a special character combination – known as an escape code in
JavaScript – used for “line feed” or new line".

You can find information about escape codes in the Appendix of the
Servoy Developer Edition Volume 2: Reference Guide, beginning on page
281 of the printed book version. This same information is also available in
the Servoy Help Navigator (F1) and in the corresponding pdf file.

The section on escape codes also contains a table that lists and
describes all of the JavaScript escape codes – any of which can be used
in a Servoy method.


Marc Norman
Servoy

mnorman:

Is there a syntax available for inserting new paragraph breaks into dialogues? Specifically, the plugin.dialogs.showInfoDialog().

\n is a special character combination – known as an escape code in
JavaScript – used for “line feed” or new line".

You can find information about escape codes in the Appendix of the
Servoy Developer Edition Volume 2: Reference Guide, beginning on page
281 of the printed book version. This same information is also avaliable in the Servoy Help Navigator (F1) and in the corresponding pdf file.

The section on escape codes also contains a table that lists and
describes all of the JavaScript escape codes – any of which can be used
in a Servoy method.


Marc Norman
Servoy

Thank, that helps. I keep forgetting you can embed code within a text message.

Even better, you can use HTML to change font sizes, colors etc… (however, you should use
instead of \n in this case)

IT2BE:
Even better, you can use HTML to change font sizes, colors etc… (however, you should use
instead of \n in this case)

That’s very good news. However the following (my best guesses at required syntax) results in syntax errors.

plugins.dialogs.showDialogInfo('Info', 'Note ' + <b><font color="#FF0000">globals.gname</font></b> + ' not found.')

plugins.dialogs.showDialogInfo('Info', 'Note ' + '<b><font color="#FF0000">' + globals.gname + '</font></b>' + ' not found.')

It works, change your message into:```
’ + globals.gname + ‘

I thought that it was just tags which were missing as well but this still does not work !

I added this code into a call to a dialogue as follows :

plugins.dialogs.showInfoDialog(‘STOP’, ‘User ’ + ‘’ + globals.gName + ‘’ + ’ exists’

But it simply treats the characters inside the ‘…’ markers as a string and concatenates it to the other items to show this in the dialogue :

User harry exists

Where ‘harry’ is the content of the field ‘gName’

So am I wrong or have I misunderstood or mistyped the syntax for this entry ?

Harry

Harry, you have to start the string with the html tags so in your case it should be:```
plugins.dialogs.showInfoDialog(STOP’, ‘User ’ + ‘’ + globals.gName + ‘’ + ’ exists’ + ‘’)

Hi Marcel,

Thanks I’ve got it now !

Harry