Skip to Main Content
HCL Domino Ideas Portal

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

Status Under Consideration
Workspace Notes
Created by Guest
Created on Apr 22, 2020

Add something similar to JavaScript's template literals to LotusScript

Its not unusual to need to build a string that includes the contents of one or more variables as well as single quotes and double quotes. These can be ugly to look at and not all that obvious what is being built. Something like template literals would be a nice addition to LotusScript.

  • Attach files
  • Guest
    Reply
    |
    May 26, 2020

    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.

  • Guest
    Reply
    |
    May 15, 2020

    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>

    |)

  • Guest
    Reply
    |
    Apr 22, 2020

    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.

  • Guest
    Reply
    |
    Apr 22, 2020

    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|