• I think your issue is actually to do with how templated Strings are handled. I notice you have \n inside a string, inside the templated String in the call to Storage.write. The \n gets interpreted by the templated string, not the 'normal' string as you wanted. Easier to explain with an example:

    print(`"Hello\nWorld"`)
    "Hello
    World"
    // when what you wanted was "Hello\nWorld"
    print(`"Hello\\nWorld"`)
    "Hello\nWorld"
    

    So unfortunately it's not quite as easy as just adding backticks on either side of your code. It normally works, but not when you have escape sequences in Strings.

    Where did you see the example using require("Storage").write? I'm trying to remove references to it for this reason :(

    What I'd suggest is you clone the BangleApps repo and copy the example app to a new directory and modify the files: https://github.com/espruino/BangleApps/tree/master/apps/_example_app

    You can then either host your own BangleApps repo and then use the app loader to write everything to the watch, or you can just use the new Web IDE storage feature (the cylinder icon in the middle of the screen on http://www.espruino.com/ide/) to upload the files from disk manually.

    I'm working on extending the IDE such that you can choose to upload directly to a file, which should really help with development.

About

Avatar for Gordon @Gordon started