Writing scripts
Formatting sections of ATL into blocks can help make the ATL more readable. Separate the blocks with whitespace.
If working in a #define script, use Shift + Enter to add line breaks and separate blocks of code. This is especially important with code that includes conditions. Using Shift + Enter with text triggers a new line in the output narrative but not a new paragraph.
There is no requirement to use Shift +Enter in a #value script.
Tip
Format sections of ATL into blocks to make it more readable.
In the example below from the accelerator, you can see that the project creator added whitespace to break the ATL into blocks. If this were ATL that included text, then the line breaks would add whitespace to the narrative output, but because this ATL performs analytics operations and not text generation, no whitespace is added to the narrative output.
You can add comments in your scripts. Use “//” for single-line comments or “/* … */” for multi-line comments.
Important
Any comments you add must be inside ATL blocks (i.e. within double-bracketed content). Don’t add a comment as the very first line in your script.
Add a brief comment at the beginning of each script, explaining what the script does.
If the script produces any narrative, add an example of the narrative produced by it.
In general, it is advisable to keep scripts from getting too long. Long scripts are hard to read.
Tip
Avoid overly long scripts. If the script does too many things, break it into smaller scripts.