Welcome to the #dominoforever Product Ideas Forum! The place where you can submit product ideas and enhancement request. We encourage you to participate by voting on, commenting on, and creating new ideas. All new ideas will be evaluated by HCL Product Management & Engineering teams, and the next steps will be communicated. While not all submitted ideas will be executed upon, community feedback will play a key role in influencing which ideas are and when they will be implemented.
For more information and upcoming events around #dominoforever, please visit our Destination Domino Page
I'm aware that there are numerous ways to build strings. However, template literals are so clean and easy to read that I would really like to see them added to LotusScript.
Other languages have added them for a reason.
If you ever use a language where they are available you will know what I mean.
You can also use pipe signs to restrict a string - so you can also have quotes within it withor a problem. Second this brings another advantage - you can also write newlines with a single command.
Example:
Call stream.writeText( _
|<div class="text-danger">Hello world</div>
<div class="text-success">One command</div>
|)
I probably should have given an example. Template literals look like the following:
this template literal string will include anything I want. Single quotes ' ' and double quotes" " can be added anywhere and variables can be referenced like this ${variable1} ${variable2} ${variable3}
Variables will be inserted in the appropriate places. No need to use + to concatenate an unwieldy mess.
Unfortunately, it looks like the editor removed the back ticks that I put at the beginning and end of the template literal. Just imagine back ticks at the beginning and end of the string and you have a valid template literal.
I've never used them in JavaScript, so I'm not quite sure what is being requested, but you can use vertical bars instead of single or double quotes to allow multi-line text and embedded single and double quotes. I do that all the time.
str = |First,
second "as in breakfast",
third|