Skip to main content

#elseif

Specifies the beginning of a secondary case in a set of preprocessor conditions that begin with #if.

Description

This macro preprocessor directive specifies the beginning of a secondary case in a set of preprocessor conditions that begin with #if. Hence, it can follow #if or another #elseIf. It is followed by another #elseIf, #else or #endif. (The #elseIf directive is not for use with #ifDef or #ifNDef.) It has the form:

#elseIf <expression>
  // subsequent indented lines for specified actions

  // next preprocessor directive

where <expression> is a valid ObjectScript expression. If <expression> evaluates to a non-zero value, it is true.

Any number of spaces may separate #elseIf and <expression>. However, no spaces are permitted within <expression>. Anything following <expression> on the same line is considered a comment and is not parsed.

For an example, see #if.

Note:

#elseIf has an alternate name of #ElIf. The two names behave identically.

FeedbackOpens in a new tab