Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


6.4 Comments

A comment is something that the E compiler ignores and is only there to help the reader. Remember that one day in the future you may be the reader, and it may be quite hard to decipher your own code without a few decent comments! Comments are therefore pretty important.

You can write comments anywhere you can write whitespace that isn't part of a string. There are two kinds of comment: one uses /* to mark the start of the comment text and */ to mark the end, and the other uses -> to mark the start, with the comment text continuing to the end of the line. You must be careful not to write /*, */ or -> as part of the comment text, unless part of a nested comment. In practice a comment is best put on a line by itself or after the end of the code on a line.

   /* This line is a comment */
   x:=1  /* This line contains an assignment then a comment */
/* y:=2  /* This whole line is a comment with a nested comment */*/

   x:=1  -> Assignment then a comment
-> y:=2  /* A nested comment comment */


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.