bdfs1m0zStructured Programming Macros

#IF Macro Group

Use this macro group to process specific code based on a set of conditions. The #IF macro group includes the following macros:

See #IF Macro Group Processing for a diagram that shows the processing flow of the #IF macro group.

Format




Notes:

  1. Only code the #EIFM macro when you are nesting #IF structures. The #EIF macro is not required for every #IF macro if you use the #EIFM macro.

#IF
specifies the start of the #IF structure based on a conditional expression. Any code immediately following this macro is processed if the conditional expression is true. See Conditional Expression Format for information about the syntax of a conditional expression.

PREFIX=label
specifies a prefix for all link labels generated by this macro group, where label is a 4-character alphabetic name.

code1
is the code to process when the #IF condition is true.

#ELIF
specifies the start of an additional selection (referred to as else if) based on a conditional expression. Any code immediately following this macro is processed when the #IF condition and any previous #ELIF conditions are false and the #ELIF condition is true.

See Conditional Expression Format for information about the syntax of a conditional expression.

code2
is the code to process when the #ELIF condition is true.

#ELSE
specifies the start of the else selection. Any code that follows the #ELSE macro is processed when none of the #IF or #ELIF conditions are true.

code3
is the code to process when none of the #IF or #ELIF conditions are true.

#EIF
ends the #IF structure.

#EIFM num
generates multiple #EIF macro statements, where num is the number #EIF macros to generate. Use this when multiple nested #IF structures all end at the same location.

Entry Requirements

None.

Return Conditions

Control is returned to the next sequential instruction after the #EIF macro statement unless another assembler instruction or macro passes control outside of the #IF structure.

Programming Considerations

Examples

Related Macros

#EXEC-Execute Macro.