Statement: rem – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 77

Advertising
background image

Operating Functions

Chapter 5

5–40

Mode: COMMAND and/or RUN
Type: CONTROL – Performs no operation

REM is short for REMark. REM allows you to add comments to a program
to make it easier to understand. If a REM statement appears on a line the
entire line is used for the REM statement. You cannot terminate a REM
statement using a colon (:), however, you can place a REM statement after
a colon. This allows you to place a comment on each line.

Example:

u10 REM INPUT ONE VARIABLE

u20 INPUT A

u30 REM INPUT ANOTHER VARIABLE

u40 INPUT B

u50 REM MULTIPLY THE TWO

u60 Z=A*B

u70 REM PRINT THE ANSWER

u80 PRINT Z

u90 END

u10 INPUT A: REM INPUT ONE VARIABLE

u20 INPUT B : REM INPUT ANOTHER VARIABLE

u30 Z=A*B : REM MULTIPLY THE TWO

u40 PRINT Z :REM PRINT THE ANSWER

u50 END

The following example does NOT work because the entire line is
interpreted as a REMark. The PRINT statement is not executed:

Example:

u10 REM PRINT THE NUMBER: PRINT A

Important: REMark statements add time to program execution. Use
them selectively or place them at the end of the program where they do not
affect program execution speed. Do not use REMark statements in
frequently called loops or subroutines.

5.4.27
Statement: REM

Advertising