Backticks for string literal like `ES6`

Idea created by sam_oda on Feb 27, 2018
    Active
    Score6
    • Hemant Kumar Patel
    • Benjamin Fehr
    • sam_oda
    • filemaker@i-absolute.com
    • alecgregory
    • arnoldkegebein

    Benefits

    1.It can contain multiple lines.

    Now in FileMaker calculation, line terminators are handled as a space.It is not intuitive.

    (example A)

    ValueCount("a

    b

    c")

    result: 1

    This should be

    ValueCount(`a

    b

    c`)

    result: 3

    (example B) In the webviewer definition

    NOW: We have to add ¶ per each line for compensating lost line terminators like this

    "data:text/html,¶

    <!DOCTYPE html>¶

    <html lang='en'>¶

    <head>¶

        <meta charset='UTF-8'>¶

        <title>Title</title>¶

    </head>¶

    <body>¶

        <h1 id='start'>Hello</h1>¶

        <script>¶

            var start = document.getElementById('start');¶

            start.onclick = function () {¶

                start.innerText='Bye';  ¶      

            };¶

        </script>¶

    </body>¶

    </html>¶

    "

    If we can use backticks, we are free from messy ¶

    In ES6, line terminators in string literal surrounded by backticks are always LF.

    This is very useful for debugging javascript code using web inspector.

    The reason why this is useful is discussed here.

    https://community.filemaker.com/thread/183608

     

    2.We can use double-quote in string literal without escape.

    (example)

    NOW: JSONFormatElements ( "{ \"a\" : { \"lnk\" : false, \"id\" : 12 } }" )

    If we can use backticks,

    JSONFormatElements ( `{ "a" : { "lnk" : false, "id" : 12 } }` )

     

    3.Variables( or field values) can be interpolated

    NOW: "First Name:" & $firstName & " Last Name:" & $lastName

    If we can use backticks,

    `First Name:${$firstName} Last Name:${$lastName}`