Add Comments to Blox
This may be a stupid question, but how to I add comments to the Blox editor?
// and /* */ both seem to work as I edit the script. However, after hitting "Apply" and returning to the editor my comments disappear.
Some of our scripts get really long and comments would be helpful.
Thanks,
Hi gwolfe,
In testing in the Blox editor, using opening and terminating comment syntax (/* */) worked without issue:
{ "style": "", "script": "/* Test Comment */ console.log('Test'); /* Test Comment2 */ console.log('Second Test'); /* Test Comment3 */ console.log('Third Test');", "title": "", "showCarousel": true, "body": [ { "type": "Container", "items": [ { "type": "TextBlock", "text": "❤️️ Welcome to BloX ❤️️", "style": { "text-align": "center", "font-weight": "bold", "font-size": "24px", "margin": "100px" } } ] } ], "actions": [] }
Unfortunately, what was not saved by Blox was starting a new line in the script parameter in the Blox template, which was not accepted as valid by Blox, and all changes after using a new line character were lost.
For a more readable script editor UI, using the native Script Editor UI and widget events, are preferred, in the script editor there is no limitation on formatting of the script or how many lines the script uses.
Alternatively, the code can be edited in a text editor/IDE with new lines present for readability, and when finished pasted in a single line when finished. Using the opening and terminating comment syntax (/* */) will work for comments.
.