beautypg.com

Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 45

background image

6Ć5

The ! format is interchangeable with the REM format for a comment;

however, the statements are treated differently by the compiler.
The ! format comments are downloaded with a task onto the

Processor module. Consequently, when that task is uploaded to the

operator's terminal at a later time, the comments can be

reconstructed along with the other program statements.
When the REM format comments are compiled, they are discarded

and consequently, they are not downloaded with the task. They are

not reconstructed and cannot be referenced with a GOTO or

GOSUB type transfer of control because they will not exist in the

executable task. The REM format comments serve only to document

the source file.
When programming critical applications, note that the ! format

comments use memory on the Processor module. ! statements

require a small amount of execution time even though they do not

actually execute.
The remark (REM) statement must be the only statement on a

program line. The remark (!) statement can be either the only

statement on a line or it can be one of several statements in a

multiĆstatement line as long as it is the last statement. REM and !

statements may be continued onto more than one line just like any

other statement:

10 !

THIS IS AN EXTREMELY LONG COMMENT &

SHOWING JUST HOW IT IS POSSIBLE TO &

CONTINUE A REMARK ACROSS SEVERAL LINES

10 !

This is an example of a series of several consecutive

20 !

! statements used to form a block of comments.

30 !

These comments may contain any character except

40 !

a carriage return, for example: !@$%^&*() &

+~][}{`".,??&?>%$

10 REM

This is an example of a series of several

20 REM

consecutive REM statements used to form a

30 REM

block of comments. These comments may

40 REM

contain any character except a carriage

50 REM

return, for example: !@$%&*()

60 REM

+~][}{`",:/.,?\/%$@%%#'

The following is a valid remark statement because the remark is at

the end:

10 A% = B% -23: PRINT A%:! A REMARK

The following is an invalid remark statement because the remark is

not at the end of the statement:

10 REAL = 3.57: ! NEW REMARK: PRINT

The line number of a ! remark statement can be used in a reference

from another statement, such as a GO TO statement. BASIC only

displays the remarks on the personal computer when you edit the

program. See the GOTO (GO TO) statement in section 6.4.

This manual is related to the following products: