Table of Contents

REM

Introduces a single-line comment; sometimes used for embedded meta-commands in the code

Implemented by: dartmouth1, ansimin, ansifull, hptsb, decbasic, Altair, a2int, Applesoft, TI994, CBM, Atari, msatari, level2, trscolor, colormc, Sinclair, Atom, BBC, GWBASIC, MSX, bwbasic, bw32, ABasiC, QBasic, VBDOS, FreeBASIC, minibasicmm, minibasicjs

With variations: tasc (contents not ignored if started with !)

Also written as:

Usage

10 REM THIS IS A ONE-LINE COMMENT
20 ' THIS IS ALSO A COMMENT IN ALMOST EVERY BASIC
30 ! BUT THIS IS A COMMENT IN TRUEBASIC

In most if not all BASICs, anything after a REM statement will be ignored in the same line, so it is never a good idea to insert a colon and more instructions after a REM.

Variations

In the QuickBASIC family, REM can be used for meta-commands related to matrices:

Bywater BASIC does not accept an abbreviation such as ' as of its version 2.20 .

Comments

REM, from "remark", is one of the original keywords of BASIC and it must have been implemented in every BASIC since.

Its abbreviated form as the apostrophe character (') dates back to Dartmouth 4th Edition, but strangely came from the same Dartmouth College the oddball idea to replace it with !, something that made into the ANSI "Full Basic" specification in one of its contradictions to the Minimal specification! As of February 2023, it seems that the !abbreviation of REM had been implemented solely by Dartmouth chaps' TrueBASIC.

Similar keywords

In other languages...

It is difficult to remember a modern language which uses a word-like statement for introducing single-line comments. Most of them use characters such as #, //, ; and so on.

Apparently, the lack of block comments like C's /* … */ hasn't bothered BASIC implementors and users, as alternatives are very rare.

References