The BASIC command REM is used to place remarks into BASIC-programs. The BASIC interpreter ignores all following text until end of line (even it contains BASIC commands). A program can be enriched with further explanation on how the code works and what variable names and line numbers really means. Blocks of remarks are useful to structure and separate the program and subroutines in visual blocks to make the listing more readable and keep it maintainable. Remarks are also a valuable tool for debugging purposes. Code lines may be commented in and out to quickly select different implementation for a task.

REM will be listed and printed, but this command hasn't got any effect on the program logic. But at least a space penalty is taken into account. Depending on where the remarks are located the performance of the running program may suffer notably.

Note that upper-case letters (lower/uppercase mode) may represent a BASIC token, which are visualized by means of the LIST command. Given the input line

10 rem Great Comment

after a

list

you get

10 rem chr$reat lenomment

This effect can be prevented by placing double quotes in front of the text:

10 rem "Great Comment

Other kinds of remarks

In some special constructions allows comments to be placed without using REM. But beware: it is not recommended to use it without a very good reason.

END : remark text Typical usage is to guard a subroutine from getting entered by the previous lines. In this case you may place some commentary text afte the END to describe the subroutine. This is impractical if END is used a silent variation of STOP where the program execution may continue right after the END if a CONT command is entered.