Comment Character

From CometWiki

Revision as of 08:19, 31 May 2009 by Badge (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Comment Character

The exclamation mark (!) is the comment character in Internet Basic source programs. Whenever it appears on a source line, the Internet Basic compiler will ignore the remainder of that line. If the exclamation mark is used as the first character on a line, the entire line will be ignored by the compiler and treated as a programmer comment.

If the exclamation mark is used anywhere else on a source line, the first part of the line (up to the exclamation mark) will be compiled and the remainder of the line will be ignored. This is a convenient way to place comments on the same line as source statements.

Example 1:

  !  THIS ENTIRE LINE WILL BE TREATED AS A COMMENT

In this example, the whole source line will be ignored because the comment character appears as the first character on the line.

Example 2:

  LET A = B*C/D   ! THIS COMMENT FOLLOWS A STATEMENT

In this example, the comment character follows an executable statement. The compiler will compile the first part of the line, but ignore the characters from the exclamation mark to the end of the line.

Personal tools