END Statement

Signifies the physical end of an external subroutine, multi-line IF statements, and multi-line THEN, ELSE, and ON ERROR statements.

Syntax

END

Comments

For every multi-line THEN, ELSE, and ON ERROR statement, there must be a corresponding END statement. If there are not enough END statements, the following message is displayed:

[B101] MISSING "END", "NEXT", "WHILE", "UNTIL",
  "REPEAT" OR "ELSE"; 
COMPILATION ABORTED, NO OBJECT CODE PRODUCED.

END may optionally appear as the last statement in a DataBasic program.

Excessive END Statements

If there are too many END statements, the program might compile successfully, but not all of the program statements may get compiled. You should verify that the line number indicated in the COMPILATION COMPLETE message matches the number of lines in your program.

Examples

    A=1
B=2
C=A+B
END

END signifies the physical end of this program. The use of this END is optional.

IF A>B THEN
    PRINT "A GT B"
    STOP
END ELSE
    PRINT "B LE A"
END
END

The first END statement terminates the THEN clause. The second END statement terminates the ELSE clause. The final END statement terminates the program.