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 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 |
|
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 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 |
|
Example 2 |
|
Example 3 |
|
Example 4 |
|
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.
A nested comment is a comment inside another comment. Comments can be nested if the following option setting is enabled: .
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 |
|
Example 2 |
|
Example 1 |
|
Example 2 |
|
URLs can be used within comments. Press <Ctrl> and click the URL text to open the URL in your default browser or email application.
Example |
|
URL link |
|
|
|
email link |
|
|
|
file link |
|
folder link |
|
FTP link |
|
Spaces in the URL must be replaced with %20.
If you want to insert a variable or instruction name into a comment, you can display the auto-completion list with the shortcut <Ctrl>+<Space>.