{{htmlmetatags>metatag-robots=()
metatag-title=(REM | ugBASIC User Manual)
metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum)
metatag-description=(Manual page for REM)
metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png)
metatag-og:title=(REM | ugBASIC User Manual)
metatag-og:description=(Manual page for REM)
}}
====== ugBASIC User Manual ======
===== REM =====
===== SYNTAX =====
REM [comment]
' [comment]
==== PURPOSE ====
In BASIC, the ''REM'' keyword (also abbreviated by the single quotation character ('))
is used to insert comments into code. A comment is a note or explanation that is added
to code to make it easier for the developer to understand, as well as for other
programmers who may read it in the future.
When the computer compile the ugBASIC program, it completely ignores everything that follows
the ''REM'' keyword on the same line. The word ''REM'' can be placed at the beginning of a line
or after a colon. In either case, the rest of the line will be treated as a comment.
To comment out multiple lines of code, you can use ''REM'' at the beginning of each line.
Note that you cannot continue a ''REM'' statement by using a line-continuation sequence
(''_''). This means that, for a multiple-line comment, you need to use as many ''REM''s
statements as the lines you comment.
Comments have the role to describe the purpose of a particular section of code
or individual statement, and it provide information about the program, who created it,
when it was created, and what changes were made. They make code easier to understand,
even for people who didn write the program: when you return to code after some time,
comments help you remember the purpose of different parts of the program.
Moreover, it is the best way to disable
a piece of code without deleting it, simply add ''REM'' to the beginning of the line.
The main guidelines in using ''REM'' it to use simple, direct language to explain the code,
avoiding long or complicated sentences. Generally, they should be used on parts of the code
that are not obvious. You do not need to comment on every single line.
==== EXAMPLE ====
REM this is a comment
' and this is a comment
PRINT "ok": REM I am printing ok
==== AVAILABLE ON ====
*
* Atari (400/800)
* Atari XL/XE
* Commodore 128 (MOS 8502)
* Commodore 128 (Zilog Z80)
* Commodore 64
* Commodore 64+REU
* TRS-80 Color Computer
* TRS-80 Color Computer 3
* ColecoVision
* Amstrad CPC 664
* Dragon 32
* Dragon 64
* Thomson MO5
* Thomson MO5
* Olivetti Prodest PC128
* Commodore PLUS/4
* SEGA SC-3000
* SEGA SG-1000
*
* VG-5000
* Commodore VIC-20
* ZX Spectrum 48
==== ANY PROBLEM? ====
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON REM|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY =====
[[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]