Add Comments to Blox
- 05-17-2024
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.
.