BASIC Language Reference Manual > Command and Function Reference >

REM Statement


Allows remarks (comments) to be included in a program listing. Remarks are ignored while the program is executing.


REM [comment text]

Remarks and Examples

Remarks are often used at the beginning of a program listing to describe the program and to include credits or copyright notices. Throughout a program, comments can (and should) be used to give helpful notes to explain to a reader of the program what the program does. Example:

10 REM Chess game
20 REM by J. Smith
30 REM August 25, 2007
100 PRINT "Chess"
110 ROWS = 8 : REM Chessboard consists of 8 rows and columns
2000 REM Ask the player if he/she would like to play again:
2010 INPUT "Play again? (Y/N): ", PLAYAGAIN$

Note that REM statements can contain colons as part of the comments. The colons do not begin new statements; the colons and text following them are considered part of the remark, as illustrated in the following example:


Everything after the REM keyword is considered part of the comment.

The REM statement can be used alone, without any following comment text, to add a line of (nearly) empty space to a line-numbered program listing.

Note: In some BASIC dialects, an apostrophe character (" ' ") can be used as an abbreviation for the REM statement. This is not presently supported by ReadyBASIC.

Copyright 2006-2008, Kevin Matz, All Rights Reserved.