REMARK Statement All languages provide the capability for inserting programmer comments
to make the program listing more readable and to
aid in testing and documenting the program.
In BASIC, the keyword REMARK (which
may be abbreviated REM)
is used. The REMARK statement is a
nonexecutable statement; that is, the REM
and following comments appear only in the listing of
the program and do not, in any way, affect execution of the program. FORMAT:
statement
keyword any programmer comments
number
When a statement with the keyword REMARK is used, the entire line on which
the statement appears is considered a comment.
The following example shows how the REMARK statement is used to document
a program so that anyone can understand what the program is used
for:
Not only can REMARK statements be used at the beginning of a program, they
can be used throughout the program to separate different segments of a
program and to introduce subroutines or loops.
SUMMARY
BASIC is designed to be easy to learn, easy to use, and easy to remember.
BASIC programs are meant to be simple so that even
a novice can under-stand them.
Instructions which are preceded by line numbers are called program statements.
The parts of a statement are: and
descriptive information.
The BASIC character set is divided into three categories: alphabetic,
numeric,
and special characters. E notation (scientific notation) is used for representing
very large and very small numbers. BASIC has included several predefined
functions so that you dont have to code some of the more common
mathematical functions.
Line numbers tell the computer the sequence of the instructions in your
program. It is a good practice to increment your
line numbers by 10 to allow for inserting
additional statements between existing statements in your program.
Spacing within a line is not important; however, appropriate use of
spaces within a line makes it easier for you and others to read and under-stand.
The first step in entering in a statement is keying
in the line number. You do not have to key
the BASIC statements in sequence, the computer sorts
them into line number sequence. The system command LIST
causes your program
to be listed with the statements in ascending sequence by line number. The
system command RUN is
used to tell the computer to execute the program.
Unfortunately the computer does not detect logic errors; you will have
to find those through testing and debugging.
The REMARK statement
is used to aid in documenting your program.
|