In this article
Adding comments in CDL helps editing and knowledge transfer. Use "//" for single-line or block comments, and Ctrl+/ to convert blocks to comments and back.
It is highly recommended to add comments into the CDL at every opportunity as they will simplify later editing.
Adding comments in the code will significantly ease the process of building the dashboard and help transfer the knowledge of those who built or edited the dashboard to future inheritors. This is especially important for custom CDL scripts, given their custom nature.
Comments enable you to provide descriptions of your actions and reasoning, and to keep track of the intended purpose of different blocks in the code. They also allow you to make the compiler ignore lines of code, such as temporarily hiding objects while building the report or avoiding compiler errors before the object is finished.
To create a single line comment in CDL, add two slash characters "//" in front of the code or text you want the compiler to ignore. Any text to the right of the "//" on the same line will be ignored. To comment out a block of code, add the "//" characters to the beginning of each line in the block.
Example of comments being used to add useful information to a widget
If you need to convert a large block of code into comments, for example when setting up a widget and you don't want the in-progress code to affect the rest of the report, you can select the entire block of code and press Ctrl+/ on your keyboard. This will simultaneously add the "//" characters to every selected line of code. To revert the comments back to normal code, simply select the block and press Ctrl+/ again.