Comments in IL editor

Introduction

You can use comments in your code to help others understand the intent of the program or function. Comments can be placed anywhere where a space character is allowed, except within character string literals. Comments have no impact on the execution of the program.

Single-line comments

Single line comments begin with a double slash // and end at the end of the line. In single-line comments, the special character combinations (* and *) or /* and */ have no special meaning like in multi-line comments.

Example

LD ® TRUE
ST ® bFan // Turn on the fan

Single-line comments are supported by Control FPWIN Pro7 from version 7.6.0.0 onwards. They cause a compiler error in older Control FPWIN Pro7 versions.

Multi-line comments

Multi-line comments begin either with (* and end with *) or with /* and end with */. This type of comment can wrap over multiple lines.In multi-line comments, the special character combination // has no special meaning like in single-line comments.

Example 1

(* Calculate fan //speed// *)

Example 2

(*-------------------
* Calculate
fan speed *)

Example 3

/* Calculate fan //speed// */

Example 4

/*-------------------
* Calculate fan speed
*/
NOTE

Multi-line comments using slashes ("/*") are supported by Control FPWIN Pro7 from version 7.6.0.0 onwards. They cause a compiler error in older Control FPWIN Pro7 versions.

Nesting of multi-line comments

A nested comment is a comment inside another comment. Comments can be nested if the following option setting is enabled: Extras > Options > Compile options > Additional Errors > Nested multi-line comments.

With nested comments, you can quickly and easily comment out large blocks of code, even if the code already contains multi-line or single line comments.

Example 1

/* This is a multi-line comment
(* this is also a multi-line comment*) /*another multi-line comment*/
This is still part of the multi-line comment */

Example 2

(* Commented out code
/* Calculate fan speed */
LD ® TRUE
ST ® bFan // Turn on the fan
*)

Incorrect comments

Example 1

(* wrong comment end characters */
/* wrong comment end characters *)

Example 2

/* Incorrect comment
/* /* This should be incorrect.
*/
Related topics:

Modified on: 2022-09-27Feedback on this pagePanasonic hotline