## ALP Programming Guide and Reference

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

### ELSEIFxx/ELSE (Begin Alternate Conditional Block)

Each conditional directive can be used with the ELSE directive to provide the statements to be considered for conditional assembly. The ELSE directive allows the assembly of the statements following it when the IFxx condition or intervening ELSEIFxx conditions are false.

Syntax

    IFxx
        .
        .
        .
    [ ELSEIFxx ]   ( optional )
        .
        .
        .
    [ ELSE ]   ( optional )
        .
        .
        .
    ENDIF

Remarks

There is a corresponding ELSEIFxx directive to match all forms of the IFxx family of directives:

ELSEIF
ELSEIFB
ELSEIFDEF
ELSEIFDIF
ELSEIFDIFI
ELSEIFE
ELSEIFIDN
ELSEIFIDNI
ELSEIFNB
ELSEIFNDEF
ELSEIF1
ELSEIF2

For information about the meaning of the conditional tests performed by the ELSEIFxx directives, refer to the definitions for the corresponding IFxx directives.

Any number of ELSEIFxx blocks may be used within a given IFxx statement. Only one ELSE block is permitted for a given IFxx. A conditional directive with more than one ELSE or an ELSE without a conditional directive causes an error. ELSE does not have an operand.

Note: The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation.

Example

    IF   DEFBUF

        BUF   DB   100   DUP ( 0 )

    ELSE

        EXTERN   BUF : BYTE

    ENDIF