END statement
Syntax
END
Description
Use the END statement to terminate a BASIC program or a section of an IF statement, , or OPEN statement.
An END statement is the last statement in a BASIC program; it indicates the logical end of the program. When an END statement that is not associated with an IF, READ, or OPEN statement is encountered, execution of the program terminates. You can use comments after the END statement.
You can also use the END statement with conditional statements in the body of a program. In this case END indicates the end of a multi-statement conditional clause.
INFORMATION and REALITY Flavors
In INFORMATION and REALITY flavors a warning message is printed if there is no final END statement. The END.WARN option of the $OPTIONS statement prints the warning message in IDEAL, IN2, PICK, and PIOPEN flavors under the same conditions.
Example
A="YES"
IF A="YES" THEN
PRINT "THESE TWO LINES WILL PRINT ONLY"
PRINT "WHEN THE VALUE OF 'A' IS 'YES'."
END
*
PRINT
PRINT "THIS IS THE END OF THE PROGRAM"
END ; * END IS THE LAST STATEMENT EXECUTED
This is the program output:
THESE TWO LINES WILL PRINT ONLY
WHEN THE VALUE OF 'A' IS 'YES'.
THIS IS THE END OF THE PROGRAM