The program:
! this program shows how the logical variables end data and
! more data change, depending on whether there is or is not
! more data available for reading
SET COLOR "blue"
IF end data then PRINT "end data is true" else PRINT "end data is false"
! gives true without data statement, false with
IF more data then PRINT "more data is true" else PRINT "more data is false"
! gives false without data statement, true with
DATA 2,3,4,5,6,7,8,9
DO while more data
READ num
LOOP
SET COLOR "red"
IF end data then PRINT "end data is true" else PRINT "end data is false"
! gives true without data statement, false with
IF more data then PRINT "more data is true" else PRINT "more data is false"
! gives false without data statement, true with
END
The output of the program:
before reading the data
end data is false
more data is true
after reading the data in a do-loop controlled by while more data
end data is true
more data is false