statement can be placed anywhere in the program, but
it
is
traditional to place it either
at the beginning or the end of the program.
What would happen if a name
is
entered, which
is
not in our list?
Run the program and enter the name CARTER and a sales amount
of
1000. The
program continues reading names
in
the DATA list until it runs out of data. The
program terminates and displays the error message:
?OD
ERROR
IN
20
indicating that an OUT OF DATA error occurred
in
line 20. The program tried
to
read
past the last name and rate in the list.
Additional names and rates can be added
to
line 70 or placed
in
another DATA
statement. The computer treats multiple DATA statements
as
one continuous list.
What you have learned:
In this lesson you have learned how a program can be made
to
BRANCH and
accomplish different tasks depending upon the value of a variable or expression. This
can be done
by
using the IFffHEN statement. The PRINTUSING statement was used
to
format the output so that it was presented
in
a more reasonable fashion than would
be the case with just the PRINT statement. You saw
how
to
use the STOP statement
to terminate execution under program control. You also learned that the READ/DATA
statements often provide a convenient method of inputing data
to
the program,
especially frequently referenced data like tables and lists.
56