DataBasic Reference > Statements and Intrinsic Functions > E > END Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

END Statement (DataBasic) (m618703+end_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

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.

RealityV15.1 (MoTW) Revision 7Comment on this topic