6

I have recently come across the term REM statement and wondered, is it synonymous with comment?

geminiCoder
  • 309
  • 2
  • 7

2 Answers2

12

Strictly REM is a REMark and it is very similar to a comment, however in Windows batch files it will be shown to the user unless either ECHO Off has been called earlier in the file or it is preceded by @ as in:

REM This will be shown during execution
@REM This will not!
@ECHO OFF
REM Nor this!

So the answer is nearly but not quite in batch files.

In BASIC it is a comment.

Steve Barnes
  • 5,300
3

REM is a statement in some older BASIC dialects, like for example in C64 BASIC. It starts a comment line. Even Visual Basic still supports it, even though the preferred syntax for comments in Microsoft dialects of BASIC is a single quote since Quick Basic.

Many people in my generation made their first programming experiments in the 80s on Commodore home computers which used a BASIC interpreter as their default command shell, so the term REM Statement as a synonym for comment might still be engrained in some people. I haven't heard anyone use that term for about 20 years, though.

Philipp
  • 23,306