• Wed 2020.04.01

    am reposting here as no response within other buried post

    see post #10 #13 #16 Technique needed to notify of low memory condition during runtime



    Just a simple request to cut-n-paste or just file upload to confirm visually the response in the WebIDE console. Looking for blank lines to be inserted between lines of text when outputting as a template literal.

    A simple confirmation or positive feedback if blank lines are seen. Then if so, what version of WebIDE, PC OS, or other helpful detail would be appreciated. Thank you.


    Not seeing blank lines as in that post #13 suggestion:

    Tutorial PPI - Programmable Peripheral Interconnect
        for the MDBT42Q Breakout board
    
    
    
    Single letter command line helper functions
    ...
    


    Template Literal example post #10 and post #13 is not rendering as such with the \n newline stripped and appears like this to me in four separate tests:

     2v03 (c) 2018 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >
    Tutorial PPI - Programmable Peripheral Interconnect
        for the MDBT42Q Breakout board
    Single letter command line helper functions
    ...
    >dump()
    function t() {
      console.log(`
    Tutorial PPI - Programmable Peripheral Interconnect
        for the MDBT42Q Breakout board
    Line 1
    Line 2
    Single letter command line helper functions
    ...
    `);
    }
    >process.env
    ={
      VERSION: "2v03",
      GIT_COMMIT: "e77d74f6",
      BOARD: "MDBT42Q",
    

    It can be observed from the dump, that the newline char isn't preserved within the function itself, and thus when attempted to then render, doesn't include the blank line as desired.



    Tested with both a nRF52 MDBT42Q and on a STM32 Pico with identical results. Also tested with both the native app and the online IDE

    No minification

    Test using native app Web IDE version 0.70.6
    Test using online Web IDE version 0.73.3

    https://www.espruino.com/ide/
    https://www.espruino.com/ide/emulator.ht­ml



    Overall goal is to reduce the number of code charaters required to output information prompt lines of text. Template Literal has been suggested to remove the repeated 'console.log()' statements.

    https://developer.mozilla.org/en-US/docs­/Web/JavaScript/Reference/Template_liter­als


    1 Attachment

  • Just tried this and you're right. Espruino's working great, but it's the Web IDE that is the issue.

    I'd tried your code previously on the command-line and it works fine, hence the confusion.

    I'll update the web-based IDE shortly to fix the problem

  • Thr 2020.04.02

    'command-line' Espruino, . . . and now yet another discovery to add to the list of ways of development arsenal. WebIDE for me.

    Thank you @Gordon, now that we know the template literal solution will help with the memory issue, don't make that a priority (for me at the moment) as that will be taking away from your skills needed with Bangle and I understand that. Put it on the back burner and include with other future IDE fixes.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Blank lines do not appear using Template Literal - Would someone perform a visual inspection on quick upload please

Posted by Avatar for Robin @Robin

Actions