The following conventions should be observed when formatting executable statements:
Note: Do not place more than one statement on a single line. While this practice is permitted in other programming languages, in Cicode the subsequent statements will not be interpreted and will effectively be lost, potentially affecting your program's runtime behavior.
|
UNINTENDED EQUIPMENT OPERATION Do not place more than one statement per line. Failure to follow these instructions can result in death, serious injury, or equipment damage. |
Although it may be argued that some statements are logically related, this is not sufficient justification. If they are logically related, place the statements on consecutive lines and separate the statements by a blank line before and after. For example:
hFile = -1; hForm = -1; // WRONG
hFile = -1; // RIGHT
hForm = -1; // RIGHT
IF <expression> THEN
... END
IF <expression> THEN
...
ELSE
...
END
IF <expression> THEN
...
ELSE
IF <expression> THEN
...
ELSE
IF <expression> THEN
...
ELSE
... END
END
END
See Also
Working with Conditional Executors
Using Cicode Programming Standards