* statement

Syntax

* [comment.text]

Description

Use the * statement to insert a comment in a BASIC program. Comments explain or document various parts of a program. They are part of the source code only and are nonexecutable. They do not affect the size of the object code.

A comment must be a separate BASIC statement, and can appear anywhere in a program. A comment must begin with one of the following comment designators:

REM * ! $*

Any text that appears between a comment designator and the end of a physical line is treated as part of the comment, not as part of the executable program. If a comment does not fit on one physical line, you can continue it on the next physical line only by starting the new line with a comment designator. If a comment appears at the end of a physical line containing an executable statement, you must put a semicolon ( ; ) before the comment designator.

Example

The PRINT statement at the end of the third line is not executed because it follows the asterisk on the same line and is treated as part of the comment. Lines 4, 5, and 6 show how to include a comment in the same sequence of executable statements.

001: PRINT "HI THERE"; * Anything after the * is a 
comment
002: * This line is also a comment and does not 
print.
003: IF 5<6 THEN PRINT "YES"; * A comment; PRINT 
"PRINT ME"
004: IF 5<6 THEN
005:      PRINT "YES"; * A comment
006:      PRINT "PRINT ME"
007: END

This is the program output:

HI THERE
YES
YES
PRINT ME