Skip to content

Elseifndef

Paul Squires edited this page Oct 14, 2026 · 2 revisions

Home › Preprocessor › #elseifndef

#elseifndef

Preprocessor conditional directive

Syntax

#ifdef A
' Conditionally included statements if A is defined
#elseifndef B
' Conditionally included statements if both A and B are not defined
#else
' Conditionally included statements if A is not defined and B is defined
#endif

Description

#elseifndef can be added to an #if block to provide an additional condition.

#elseifndef symbol is equivalent to #elseif Not defined(symbol)

Remarks

Differences from QB

  • New to Freebasic

See also

Examples

#ifdef A

    Print "A is defined"

#elseifndef B

    Print "both A and B are not defined"

#else

    Print "A is not defined and B is defined"

#endif

Category: Preprocessor
Kind: keyword


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally