## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### ENDS (Close a Segment, Structure, or Union Declaration)

Closes a program segment opened with SEGMENT directive, or ends a structure or union definition opened with the STRUCT or UNION directives. Every SEGMENT, STRUCT, and UNION directive must end with a corresponding ENDS directive.

Syntax

    Segment - Name   ENDS
        or
    Structure - Name   ENDS
        or
    Union - Name   ENDS

Remarks

If the ENDS directive is not used with the corresponding SEGMENT, STRUCT, or UNION directive, an error occurs. An unmatched ENDS also causes an error.

Note: See the SEGMENT, STRUCT, and UNION directives for more details and examples of the use of ENDS.

Example

    CONST      SEGMENT      word   public   ' CONST '
    SEG1       DW           ARRAY _ DATA
    SEG2       DW           MESSAGE _ DATA
    CONST      ENDS