Making Code Readable
Commenting code and limiting line length both promote readability. See the following sections for details.
Using Code Comments
In IDL, the semicolon (;) is the comment character. When IDL encounters the semicolon, it ignores the remainder of the line. It is good programming practice to fully document programs with comments. Comments in IDL do not slow down code execution or add noticeable size to IDL files.
A comment can exist on a line by itself, or can follow another IDL statement, as shown below:
Using Line Continuations
The line continuation character ($) allows you to break a single IDL statement into multiple lines. The dollar sign at the end of a line indicates that the current statement is continued on the following line. The dollar sign character can appear anywhere a space is legal, except within a string constant or between a function name and the first open parenthesis. Any number of continuation lines are allowed. The following example shows a line continuation after the space at the end of the third line:
PRO sample_recurse2, oNode, indent ;; "Visit" the node by printing its name and value PRINT, indent gt 0 ? STRJOIN(REPLICATE(' ', indent)) : '', $ oNode->GetNodeName(), ':', oNode->GetNodeValue() ...